/* =========================================================
   ScanMyIP — SaaS dashboard aesthetic, purple monochrome
   ========================================================= */

:root {
  /* Neutrals */
  --bg: #f7f7fb;
  --surface: #ffffff;
  --border: #ececf3;
  --border-strong: #e0e0ea;
  --hover: #faf9fc;

  /* Text */
  --text: #1a1a2e;
  --text-muted: #6b6b7d;
  --text-soft: #9999a8;

  /* Brand — single purple, varied shades */
  --purple-50:  #f5f3ff;
  --purple-100: #ede9fe;
  --purple-200: #ddd6fe;
  --purple-400: #a78bfa;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;
  --purple-700: #6d28d9;

  /* Functional accents (used sparingly) */
  --green-50:  #ecfdf5;
  --green-500: #10b981;
  --green-700: #047857;

  /* Effects */
  --shadow-card: 0 1px 2px rgba(20, 16, 41, 0.04);
  --shadow-card-hover: 0 4px 16px rgba(20, 16, 41, 0.08);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;

  --max-width: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* =========================================================
   Shared card
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  background: var(--bg);
  padding: 1rem 1.5rem 0;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.logo-img {
  height: 36px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: all 0.15s ease;
}

.site-nav a:hover {
  color: var(--purple-700);
  background: var(--purple-50);
}

/* =========================================================
   Main dashboard layout
   ========================================================= */
.dashboard {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* =========================================================
   Hero card — the big IP reveal
   ========================================================= */
.hero-card {
  padding: 1.5rem 1.75rem 2.25rem;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.06), transparent 60%);
  pointer-events: none;
}

.hero-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.hero-card-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--green-500);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.08); }
}

.hero-card-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 500;
}

.hero-card-body {
  text-align: center;
  padding: 0.5rem 0 0;
  position: relative;
  z-index: 1;
}

.ip-kicker {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1.25rem;
  letter-spacing: -0.005em;
}

.protocol-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  background: var(--purple-100);
  color: var(--purple-700);
  border: 1px solid var(--purple-200);
}
.protocol-tag--v4 {
  background: var(--purple-100);
  color: var(--purple-700);
  border-color: var(--purple-200);
}
.protocol-tag--v6 {
  background: var(--green-50);
  color: var(--green-700);
  border-color: #a7f3d0;
}

.ip-display {
  margin-bottom: 1.75rem;
  padding: 0 0.5rem;
}

#ip-value {
  display: inline-block;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-weight: 800;
  font-size: clamp(2.5rem, 11vw, 7.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #7c3aed 0%, #4c1d95 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding: 0.1em 0;
  max-width: 100%;
  white-space: nowrap;
}

#ip-value.ip-long {
  font-size: clamp(1rem, 3.4vw, 2.25rem);
  letter-spacing: -0.02em;
  white-space: normal;
  word-break: break-all;
  line-height: 1.2;
  max-width: 95%;
  margin: 0 auto;
  display: block;
}

#ip-value.ip-loading {
  font-size: clamp(1.25rem, 4vw, 2.25rem);
  font-weight: 600;
  background: var(--text-soft);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-actions {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.625rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.btn-primary {
  background: var(--purple-600);
  color: #fff;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.btn-primary:hover { background: var(--purple-700); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.copied {
  background: var(--green-500);
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.18);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--hover);
  border-color: var(--purple-200);
  color: var(--purple-700);
}

/* =========================================================
   KPI row (4 stat cards)
   ========================================================= */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.8fr 1fr;
  gap: 1rem;
}

.kpi-card--wide {
  /* Just a marker class - the grid handles sizing */
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.15rem;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

.kpi-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.625rem;
}

.kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.kpi-icon--purple { background: var(--purple-100); color: var(--purple-600); }
.kpi-icon--green  { background: var(--green-50);   color: var(--green-700); }

.kpi-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.kpi-value--mono {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-all;
  line-height: 1.3;
  color: var(--purple-700);
}

.kpi-value--muted {
  color: var(--text-soft);
  font-style: italic;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}

.kpi-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.15rem;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.kpi-delta--up {
  background: var(--green-50);
  color: var(--green-700);
}

.kpi-delta--neutral {
  background: var(--purple-50);
  color: var(--purple-700);
}

/* =========================================================
   Section heading
   ========================================================= */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

.section-head h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.section-link {
  font-size: 0.85rem;
  color: var(--purple-700);
  font-weight: 600;
  transition: opacity 0.15s ease;
}
.section-link:hover { opacity: 0.7; }

/* =========================================================
   Connection details cards
   ========================================================= */
.details-section {
  display: flex;
  flex-direction: column;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.detail-card {
  padding: 1.1rem 1.25rem 1.15rem;
  transition: all 0.2s ease;
}

.detail-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.625rem;
}

.detail-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.detail-value {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 0.35rem;
  word-break: break-word;
  min-height: 1.4em;
}

.detail-meta {
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* =========================================================
   Bottom row — explainer + tools
   ========================================================= */
.bottom-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}

.explainer-card {
  padding: 1.75rem 1.75rem 2rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple-600);
  background: var(--purple-50);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.explainer-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  color: var(--text);
}

.explainer-card p {
  color: var(--text-muted);
  font-size: 0.97rem;
  margin-bottom: 0.9rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--purple-700);
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 0.5rem;
  transition: gap 0.15s ease;
}
.link-arrow:hover { gap: 0.55rem; }

/* Tools card */
.tools-card { padding: 1.5rem 1.5rem 0.75rem; }

.tools-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.875rem;
}

.tools-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.badge-soft {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--purple-700);
  background: var(--purple-50);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.tools-list {
  list-style: none;
}

.tools-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  transition: background 0.15s ease;
  cursor: pointer;
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--radius-sm);
}

.tools-list li:first-child { border-top: none; }

.tools-list li:hover {
  background: var(--hover);
}

.tool-info { display: flex; flex-direction: column; gap: 0.15rem; }
.tool-info strong { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.tool-info span { font-size: 0.8rem; color: var(--text-muted); }

.tool-arrow {
  color: var(--text-soft);
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

.tools-list li:hover .tool-arrow {
  color: var(--purple-600);
  transform: translateX(2px);
}

/* =========================================================
   Footer
   ========================================================= */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-brand .logo { margin-bottom: 0.75rem; }
.footer-tag {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 320px;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}
.footer-nav a:hover { color: var(--purple-700); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.85rem;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-card--wide { grid-column: span 2; }
  .details-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { padding: 0.75rem 0.75rem 0; }
  .header-inner { padding: 0.5rem 0.75rem 0.5rem 0.85rem; }
  .logo-img { height: 28px; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 0.4rem 0.55rem; font-size: 0.85rem; }

  .dashboard { padding: 1rem 0.75rem 2rem; gap: 0.75rem; }

  .hero-card { padding: 1.25rem 1.25rem 1.75rem; }
  .hero-card-head { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .hero-actions { width: 100%; flex-direction: column; }
  .hero-actions .btn { justify-content: center; width: 100%; }

  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
  .kpi-card--wide { grid-column: span 2; }
  .kpi-card { padding: 0.875rem 1rem; }
  .kpi-value { font-size: 1.4rem; }

  .details-grid { grid-template-columns: 1fr; }

  .explainer-card { padding: 1.5rem 1.25rem; }
  .explainer-card h2 { font-size: 1.35rem; }

  .footer-inner { flex-direction: column; gap: 1.5rem; padding: 2rem 1rem 1.5rem; }
}

@media (max-width: 380px) {
  .logo-img { height: 24px; }
}
