/* Design system adapted from psylo.app (dark, purple accent) for the proxy leak test. */

@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/syne-normal-400-800-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+131, U+152-153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-normal-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+131, U+152-153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-normal-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+131, U+152-153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-normal-600-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+131, U+152-153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(fonts/jetbrains-mono-normal-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+131, U+152-153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  --purple: #7e2de4;
  --purple-dark: #5a1db0;
  --purple-light: #a855f7;
  --orange: #ff9800;
  --red: #ef4444;
  --yellow: #facc15;
  --bg: #0b0a11;
  --bg-elevated: #111114;
  --text: #f4f4f5;
  --text-muted: #9c9ca8;
  --border: rgba(255, 255, 255, 0.06);
  --radius: 20px;
  --radius-xs: 6px;
  --radius-md: 16px;
  --radius-xl: 32px;
  --radius-pill: 100px;
  --radius-app-icon: 18px;
  --space-2: 8px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-20: 80px;
  --space-24: 96px;
  --container-max: 1100px;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Syne", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.05em 0.3em;
  border-radius: 4px;
}

/* --- Nav --- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 var(--space-6);
  background: rgba(11, 10, 17, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-logo img {
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links .nav-cta {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: var(--text);
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 4px 12px rgba(126, 45, 228, 0.2);
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.nav-links .nav-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 6px 16px rgba(126, 45, 228, 0.3);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: 0 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}

.nav-hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
  visibility: hidden;
  pointer-events: none;
}

.nav-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.nav-drawer-inner {
  display: flex;
  flex-direction: column;
  padding: 80px 28px 40px;
  gap: 4px;
}

.nav-drawer-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}

.nav-drawer-link:hover {
  color: var(--text);
}

.nav-drawer-cta,
.nav-drawer-cta:hover {
  margin-top: 20px;
  border: none;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: var(--text);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(126, 45, 228, 0.3);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-overlay,
  .nav-drawer {
    display: block;
  }
}

/* --- Hero --- */

.sub-hero {
  position: relative;
  padding: 140px 24px 48px;
  text-align: center;
  overflow: hidden;
}

.sub-hero-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: max(100%, 600px);
  height: 500px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 20%, rgba(126, 45, 228, 0.1) 0%, rgba(126, 45, 228, 0.03) 50%, transparent 75%);
}

.sub-hero .container {
  position: relative;
  z-index: 1;
}

.section-label {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-light);
  padding: 0;
  margin-bottom: var(--space-5);
  padding-top: 12px;
  border-top: 2px solid var(--purple);
}

.sub-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.05em;
  margin: 0 0 var(--space-4);
  color: var(--text);
  text-wrap: balance;
}

.gradient-text {
  display: block;
  background: linear-gradient(120deg, var(--purple-light) 0%, #d946a0 33%, #f97316 66%, var(--purple-light) 100%);
  background-size: 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 12s linear infinite;
  padding-bottom: 0.35em;
  margin-bottom: -0.35em;
}

@keyframes gradient-shift {
  0% {
    background-position: 0;
  }

  100% {
    background-position: 300% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gradient-text {
    animation: none;
    background-position: 0;
  }
}

.sub-hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Leak cards --- */

.leak-results {
  padding: 0 0 64px;
}

.leak-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.leak-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: border-color 0.3s;
}

.leak-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.leak-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.leak-card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.leak-card-icon--red {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

.leak-card-icon--orange {
  background: rgba(255, 152, 0, 0.1);
  color: var(--orange);
}

.leak-card-icon--purple {
  background: rgba(126, 45, 228, 0.1);
  color: var(--purple-light);
}

.leak-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 1;
  margin: 0;
}

.leak-rows {
  display: flex;
  flex-direction: column;
}

.leak-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.leak-row:last-child {
  border-bottom: none;
}

.leak-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.leak-value {
  font-size: 0.88rem;
  color: var(--text);
  text-align: right;
  word-break: break-word;
  min-width: 0;
}

.leak-value--mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}

.leak-skeleton {
  display: inline-block;
  width: 100px;
  height: 14px;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, rgba(255, 255, 255, 4%) 25%, rgba(255, 255, 255, 8%) 50%, rgba(255, 255, 255, 4%) 75%);
  background-size: 200% 100%;
  animation: leak-shimmer 1.5s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes leak-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Probe result lists (populated by demo.js) */

.ip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.ip-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.ip-list li.empty {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.ip-list .loc {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 0.78rem;
}

@media (max-width: 768px) {
  .sub-hero {
    padding: 110px 24px 40px;
  }

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

@media (max-width: 640px) {
  .leak-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .leak-value {
    text-align: left;
  }

  .ip-list {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .leak-card {
    padding: 20px;
  }
}

/* --- CTA --- */

.leak-cta {
  padding: 0 0 var(--space-24);
  text-align: center;
}

.cta-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  background: rgba(126, 45, 228, 4%);
  border: 1px solid rgba(126, 45, 228, 0.14);
  border-radius: var(--radius-xl);
  padding: 56px 48px;
  max-width: 560px;
  margin: 0 auto;
}

.cta-card-icon {
  border-radius: var(--radius-app-icon);
  box-shadow: 0 12px 40px rgba(126, 45, 228, 0.3);
}

.leak-cta-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0;
}

.leak-cta-body {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.7;
  margin: 0 0 4px;
}

.app-store-badge {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
}

.app-store-badge:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

.app-store-badge img {
  display: block;
  height: 54px;
  width: auto;
  border-radius: 12px;
}

.leak-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--purple-light);
  text-decoration: none;
  transition: color 0.2s, gap 0.25s;
}

.leak-home-link:hover {
  color: var(--text);
  gap: 10px;
}

@media (max-width: 768px) {
  .leak-cta {
    padding: 0 0 var(--space-20);
  }

  .leak-cta .cta-card {
    padding: 40px 24px;
    border-radius: 24px;
  }
}

/* --- Footer --- */

.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-10) 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 0.95rem;
}

.footer-brand img {
  border-radius: var(--radius-xs);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  margin: 0;
}

.footer-copy a {
  color: var(--purple-light);
  text-decoration: none;
}

.footer-copy a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .footer-top {
    flex-direction: column;
    gap: 16px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
