/* ===================================================
   Code Cats - site.css
   =================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background-color: #09090b;
  color: #fafafa;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}
::selection {
  background: rgba(95, 133, 219, 0.25);
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #09090b;
}
::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}

/* --- Accent color ---------------------------------- */
.text-accent {
  color: #5f85db;
}

/* --- Buttons --------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #5f85db;
  color: #fff;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
.btn-primary:hover {
  background: #4d72c8;
  color: #fff;
  box-shadow: 0 4px 16px rgba(95, 133, 219, 0.3);
}
.btn-primary:focus-visible {
  outline: 2px solid #5f85db;
  outline-offset: 2px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #a1a1aa;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid #27272a;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}
.btn-ghost:hover {
  color: #fafafa;
  border-color: #52525b;
  background: rgba(255, 255, 255, 0.04);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #5f85db;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid rgba(95, 133, 219, 0.4);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-outline:hover {
  background: rgba(95, 133, 219, 0.1);
  border-color: #5f85db;
  color: #93b5e8;
}

/* --- Navigation ------------------------------------ */
.nav-link {
  color: #a1a1aa;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition:
    color 0.15s,
    background 0.15s;
  line-height: 1;
}
.nav-link:hover {
  color: #fafafa;
  background: rgba(255, 255, 255, 0.05);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 0.75rem;
  overflow: hidden;
  z-index: 200;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  color: #a1a1aa;
  font-size: 0.8125rem;
  font-weight: 500;
  transition:
    color 0.12s,
    background 0.12s;
}
.nav-dropdown-item:hover {
  color: #fafafa;
  background: rgba(255, 255, 255, 0.05);
}
.nav-dropdown-item .di {
  color: #5f85db;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.nav-divider {
  height: 1px;
  background: #27272a;
  margin: 0.25rem 0;
}

.m-section {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #52525b;
  padding: 0.75rem 0.75rem 0.25rem;
  font-weight: 600;
}
.m-link {
  display: block;
  color: #a1a1aa;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition:
    color 0.15s,
    background 0.15s;
}
.m-link:hover {
  color: #fafafa;
  background: rgba(255, 255, 255, 0.05);
}

/* --- Page hero (service pages) --------------------- */
.page-hero {
  padding: 8rem 0 4rem;
  position: relative;
  overflow: hidden;
  background: #09090b;
  border-bottom: 1px solid #18181b;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 50% at 50% 0%,
    rgba(95, 133, 219, 0.07) 0%,
    transparent 70%
  );
  pointer-events: none;
}
[data-has-crumbs] .page-hero {
  padding-top: 1.75rem;
}
[data-has-crumbs] .page-hero::before {
  background: radial-gradient(
    ellipse 60% 50% at 50% -15%,
    rgba(95, 133, 219, 0.07) 0%,
    transparent 70%
  );
}.page-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5f85db;
  margin-bottom: 1rem;
}
.page-hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #fafafa;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.page-hero-sub {
  font-size: 1.0625rem;
  color: #71717a;
  margin-top: 0.75rem;
  max-width: 520px;
  line-height: 1.65;
}

/* --- Section headings ------------------------------ */
.section-title {
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  font-weight: 700;
  color: #fafafa;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.section-sub {
  color: #71717a;
  font-size: 1rem;
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* --- Cards ----------------------------------------- */
.card {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 1rem;
}
.card-hover {
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.card-hover:hover {
  border-color: rgba(95, 133, 219, 0.3);
  box-shadow:
    0 0 0 1px rgba(95, 133, 219, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.4);
}
.card-featured {
  border-color: rgba(234, 179, 8, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.12);
}

/* --- Feature icon ---------------------------------- */
.feat-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(95, 133, 219, 0.1);
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f85db;
  font-size: 1rem;
  flex-shrink: 0;
}

/* --- noUiSlider dark skin -------------------------- */
.noUi-target {
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 4px;
  height: 6px;
  box-shadow: none;
  margin: 1.5rem 0.625rem;
}
.noUi-connect {
  background: #5f85db;
}
.noUi-horizontal .noUi-handle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4d72c8;
  border: 2px solid #5f85db;
  box-shadow: 0 0 0 4px rgba(95, 133, 219, 0.15);
  top: -8px;
  right: -11px;
  cursor: grab;
}
.noUi-horizontal .noUi-handle:active {
  cursor: grabbing;
}
.noUi-handle::before,
.noUi-handle::after {
  display: none;
}
.noUi-tooltip {
  background: #18181b;
  border: 1px solid #3f3f46;
  color: #fafafa;
  font-size: 0.75rem;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* --- Tabs ------------------------------------------ */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 0.625rem;
  padding: 0.25rem;
  width: fit-content;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #71717a;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  border: none;
  white-space: nowrap;
}
.tab-btn:hover {
  color: #a1a1aa;
}
.tab-btn.active {
  color: #fafafa;
  background: #09090b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* --- Accordion ------------------------------------- */
.accordion-item {
  border-bottom: 1px solid #27272a;
}
.accordion-item:last-child {
  border-bottom: none;
}
.accordion-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1.25rem 0;
  text-align: left;
  color: #e4e4e7;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  gap: 1rem;
  transition: color 0.15s;
}
.accordion-trigger:hover {
  color: #fff;
}
.accordion-chevron {
  transition: transform 0.2s;
  color: #52525b;
  flex-shrink: 0;
  font-size: 0.75rem;
}
.accordion-trigger[aria-expanded="true"] .accordion-chevron {
  transform: rotate(180deg);
}
.accordion-body {
  padding-bottom: 1.25rem;
  color: #a1a1aa;
  line-height: 1.75;
  font-size: 0.875rem;
}
.accordion-body a {
  color: #5f85db;
}
.accordion-body a:hover {
  color: #93b5e8;
}
.accordion-body ol {
  list-style: decimal;
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}
.accordion-body ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}
.accordion-body li {
  margin-bottom: 0.25rem;
}

/* --- Data tables ----------------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  color: #d4d4d8;
}
.data-table thead tr {
  border-bottom: 1px solid #27272a;
}
.data-table th {
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #52525b;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
}
.data-table th:first-child {
  text-align: left;
}
.data-table th:last-child {
  text-align: right;
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(39, 39, 42, 0.5);
  vertical-align: middle;
  text-align: center;
}
.data-table td:first-child {
  text-align: left;
}
.data-table td:last-child {
  text-align: right;
}
.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table .link-cell {
  color: #5f85db;
  font-weight: 500;
}
.data-table .link-cell:hover {
  color: #93b5e8;
  text-decoration: underline;
}
.data-table .good {
  color: #22c55e;
  font-weight: 500;
}
.data-table .bad {
  color: #ef4444;
}
.data-table .bold-col {
  font-weight: 600;
  color: #fafafa;
}

/* --- Prose (ToS/Privacy) --------------------------- */
.prose-dark {
  color: #a1a1aa;
  line-height: 1.8;
  font-size: 0.9375rem;
  max-width: 72ch;
}
.prose-dark h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fafafa;
  margin: 2rem 0 0.625rem;
}
.prose-dark h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #fafafa;
  margin: 1.5rem 0 0.5rem;
}
.prose-dark p {
  margin-bottom: 1rem;
}
.prose-dark ul,
.prose-dark ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.prose-dark ul {
  list-style: disc;
}
.prose-dark ol {
  list-style: decimal;
}
.prose-dark li {
  margin-bottom: 0.25rem;
}
.prose-dark a {
  color: #5f85db;
}
.prose-dark a:hover {
  color: #93b5e8;
}
.prose-dark strong {
  color: #fafafa;
  font-weight: 600;
}
.prose-dark code {
  background: #27272a;
  color: #a5b4fc;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.85em;
}

/* --- Tooltip (env table) --------------------------- */
.tt {
  position: relative;
  display: inline-block;
}
.tt-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #18181b;
  border: 1px solid #3f3f46;
  color: #d4d4d8;
  font-size: 0.75rem;
  line-height: 1.6;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  width: max-content;
  max-width: 280px;
  white-space: pre-wrap;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.15s,
    visibility 0.15s;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  text-align: left;
}
.tt:hover .tt-content {
  opacity: 1;
  visibility: visible;
}

/* --- Announcement bar ------------------------------ */
#ann-bar code {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.22);
  color: inherit;
  padding: 0.1em 0.45em;
  border-radius: 0.25rem;
  font-size: 0.95em;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: ui-monospace, "Cascadia Code", monospace;
}

/* --- Misc ------------------------------------------ */
.divider {
  height: 1px;
  background: #27272a;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-blue {
  background: rgba(95, 133, 219, 0.15);
  color: #93b5e8;
  border: 1px solid rgba(95, 133, 219, 0.2);
}
.badge-green {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.badge-new {
  background: rgba(234, 179, 8, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.2);
}
.badge-neutral {
  background: rgba(255,255,255,0.04);
  color: #a1a1aa;
  border: 1px solid #27272a;
}
.lat-dot { display:inline-block; width:6px; height:6px; border-radius:50%; background:#3f3f46; flex-shrink:0; }
.lat-good { background:#22c55e; }
.lat-mid  { background:#f59e0b; }
.lat-slow { background:#ef4444; }

/* --- Search input ---------------------------------- */
.search-input {
  width: 100%;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 0.5rem;
  color: #fafafa;
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  outline: none;
  transition: border-color 0.15s;
}
.search-input::placeholder {
  color: #52525b;
}
.search-input:focus {
  border-color: #5f85db;
}

/* --- Lightbox -------------------------------------- */
img[data-lightbox] { cursor: zoom-in; transition: opacity 0.15s; }
img[data-lightbox]:hover { opacity: 0.8; }
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 2rem;
}
#lightbox.lb-open { display: flex; }
#lightbox-img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 0.875rem;
  border: 1px solid #27272a;
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.9);
  cursor: default;
  object-fit: contain;
}
#lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: #27272a;
  border: none;
  color: #a1a1aa;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
#lightbox-close:hover { background: #3f3f46; color: #fafafa; }

/* --- Scroll reveal --------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  }
  [data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Gradient text --------------------------------- */
.text-gradient {
  background: linear-gradient(130deg, #5f85db 0%, #a5c4f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Active nav link ------------------------------- */
.nav-link-active {
  color: #fafafa !important;
  position: relative;
}
.nav-link-active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: #5f85db;
  border-radius: 2px;
}
.m-link-active {
  color: #fafafa !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

/* --- Locations world map section ------------------- */
.loc-map-wrap {
  position: relative;
  height: 380px;
  overflow: hidden;
}
@media (max-width: 640px) {
  .loc-map-wrap { height: 270px; }
}

/* Always-visible callout label below each city dot */
.loc-callout {
  position: absolute;
  transform: translate(-50%, 3px); /* 3px = half dot height, so stem starts flush */
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}
.loc-callout-inner {
  background: rgba(9, 9, 11, 0.88);
  border: 1px solid #27272a;
  border-radius: 0.5rem;
  padding: 0.55rem 0.9rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}
.loc-callout-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}
.loc-callout-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e4e4e7;
}
.loc-callout-latency {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #71717a;
}
/* connector stem — sits above the card, pointing up to the dot */
.loc-callout-stem {
  width: 1px;
  height: 14px;
  background: #3f3f46;
}

/* latency status dot */
.loc-lat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3f3f46;
  flex-shrink: 0;
  transition: background 0.3s;
}
.loc-lat-dot.loc-lat-good { background: #22c55e; }
.loc-lat-dot.loc-lat-mid  { background: #f59e0b; }
.loc-lat-dot.loc-lat-slow { background: #ef4444; }
.loc-lat-dot.loc-lat-err  { background: #52525b; }

.loc-lat-value {
  transition: color 0.3s;
  font-variant-numeric: tabular-nums;
}

/* --- World map city markers (features section) ----- */
.city-marker {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  z-index: 1;
}
.city-dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #5f85db;
  box-shadow: 0 0 8px 3px rgba(95, 133, 219, 0.65);
}
.city-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(95, 133, 219, 0.55);
  animation: city-pulse 2.4s ease-out infinite;
}
@keyframes city-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(5.5); opacity: 0;   }
}
