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

:root {
  --bg-primary:   #0d1117;
  --bg-secondary: #161b22;
  --bg-card:      #1c2333;
  --accent:       #00c7b4;
  --text-primary: #e6edf3;
  --text-muted:   #7d8590;
  --border:       rgba(255,255,255,0.08);
  --radius:       12px;
  --badge-warn:   #f0b232;
  --badge-error:  #f07178;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ── BLOG TAG FILTER ── */
.blog-tag-filter {
  padding: .4rem 1rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
  min-height: 36px;
}
.blog-tag-filter:hover { border-color: var(--accent); color: var(--accent); }
.blog-tag-filter.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

/* ── FAQ ACCORDION ── */
.faq-answer {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .3s ease, opacity .2s ease, padding .2s ease;
  padding: 0 0;
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.faq-answer.open {
  max-height: 500px;
  opacity: 1;
  padding: .75rem 0 .25rem;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: .9rem 0;
}
.faq-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 44px;
  padding: 0;
}
.faq-btn-text {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.faq-btn-icon {
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ── SCREEN READER ONLY ── */
.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;
}

/* ── SKIP LINK (accessibility) ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent);
  color: #000;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 200;
  transition: top .2s;
}
.skip-link:focus {
  top: .5rem;
}

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-logo svg { color: var(--accent); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.nav-active {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
.nav-ip {
  font-size: .8rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: .3rem .75rem;
  border-radius: 99px;
  border: 1px solid var(--border);
}

/* ── BREADCRUMB ── */
.breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* ── PAGE WRAPPER ── */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.page-title {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 700;
  margin-bottom: .4rem;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 2rem;
}
.section-title {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── CARD ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color .2s;
}

/* ── BADGE ── */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-good { background: rgba(0,199,180,.15); color: var(--accent); }
.badge-mid  { background: rgba(240,178,50,.12); color: var(--badge-warn); }
.badge-low  { background: rgba(240,113,120,.12); color: var(--badge-error); }

/* ── TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  text-align: left;
  padding: .5rem .75rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: .8rem .75rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); transition: background .15s; }
.data-table tr:nth-child(even) td { background: rgba(255,255,255,.015); }

/* ── STAT GRID ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  padding: 1.25rem 1.5rem;
}
.stat-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.stat-unit {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* ── ISP LINK PILL ── */
.isp-pill {
  padding: .5rem 1.25rem;
  border-radius: 99px;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.dept-pill {
  padding: .35rem .9rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .8rem;
  text-decoration: none;
  transition: border-color .2s;
}
.dept-pill:hover { border-color: rgba(0,199,180,.4); }

/* ── INFO ROW ── */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  gap: .5rem;
}
.info-row span:last-child { text-align: right; }

/* ── NAV BURGER (desktop: oculto) ── */
.nav-burger { display: none; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--text-primary); }
.empty-state p  { font-size: .875rem; margin-bottom: 1.5rem; }
.btn-primary {
  display: inline-block;
  padding: .6rem 1.5rem;
  background: var(--accent);
  color: #000;
  border-radius: 99px;
  font-weight: 600;
  font-size: .875rem;
  text-decoration: none;
  transition: opacity .2s;
}
.btn-primary:hover { opacity: .85; }
.btn-primary:active { transform: scale(.97); }
.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── FOCUS & ACCESSIBILITY ── */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Mínimo touch target 44px (WCAG 2.5.8 — close to 48px) */
.nav-links a { min-height: 44px; display: inline-flex; align-items: center; }
.btn-primary { min-height: 44px; }
.btn-share, .btn-isp { min-height: 44px; }

/* ── FOOTER ── */
footer {
  color: var(--text-muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 2.5rem 2rem 2rem;
  max-width: 960px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.footer-col-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: .25rem;
}
.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .8rem;
  transition: color .2s;
  line-height: 1.4;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  padding: 1rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}
.footer-bottom a { color: var(--accent); text-decoration: none; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem 1rem; }
  .footer-col { align-items: center; text-align: center; }
  .footer-col-title { text-align: center; }
}

@media (max-width: 600px) {
  /* Nav hamburger */
  nav { padding: 0 1rem; }
  .nav-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .75rem;
    margin-right: -.75rem;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
  }
  .nav-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
  }
  .nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger.open span:nth-child(2) { opacity: 0; }
  .nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: .75rem 1.25rem 1rem;
    gap: .1rem;
    z-index: 99;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    font-size: .9rem;
    padding: .75rem .5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
  }
  .nav-links a:last-of-type { border-bottom: none; }
  .nav-ip { display: none; }

  /* Page */
  .page { padding: 1.5rem .875rem 3rem; }

  /* Centrar títulos y subtítulos en mobile */
  .page-title,
  .page-subtitle { text-align: center; }

  /* Cards más compactas */
  .card { padding: 1.15rem; border-radius: 10px; }
  .stat-card { padding: 1rem 1.15rem; }

  /* Stat grid: 2 columnas centradas */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .stat-card { text-align: center; }
  .stat-value { font-size: 1.5rem; }

  /* Breadcrumb centrado */
  .breadcrumb { text-align: center; }

  /* Section titles centrados */
  .section-title { text-align: center; }

  /* FAQ más compacto */
  .faq-btn-text { font-size: .85rem; }

  /* Botones ISP/dept stack en columna */
  .isp-pill { font-size: .8rem; padding: .4rem 1rem; }

  /* Blog tag filters scroll horizontal */
  .blog-tag-filter { padding: .35rem .8rem; font-size: .75rem; }

  /* Tablas horizontalmente scrolleables en mobile */
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Footer */
  .footer-bottom { padding: 1rem; }
  .footer-bottom > div { flex-direction: column; align-items: center !important; gap: .5rem !important; text-align: center; }
  .footer-bottom p { text-align: center; }

  /* ISP hero: quitar borde lateral en mobile, centrar */
  .isp-hero {
    border-left: none !important;
    padding-left: 0 !important;
    text-align: center;
  }
  .isp-hero .page-title,
  .isp-hero .page-subtitle { text-align: center; }

  /* Back to top: más cerca del borde en mobile */
  .btn-top { bottom: 1rem; right: 1rem; width: 40px; height: 40px; font-size: 1rem; }
}

/* ── SAFE AREA (notched devices) ── */
@supports (padding: env(safe-area-inset-bottom)) {
  nav { padding-left: max(2rem, env(safe-area-inset-left)); padding-right: max(2rem, env(safe-area-inset-right)); }
  .page { padding-left: max(1.5rem, env(safe-area-inset-left)); padding-right: max(1.5rem, env(safe-area-inset-right)); }
  .btn-top { bottom: max(2rem, env(safe-area-inset-bottom)); right: max(2rem, env(safe-area-inset-right)); }
}

/* ── BACK TO TOP ── */
.btn-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.btn-top:hover { background: var(--bg-card); border-color: var(--accent); }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
