/* =====================================================================
 *  Cybersecurity Friends — estilos
 *  Estética retro-arcade: fondo oscuro, degradado cian→violeta (como el logo).
 * =================================================================== */

:root {
  --bg:        #0a0a0f;
  --bg-2:      #12121c;
  --card:      #16161f;
  --card-2:    #1c1c28;
  --border:    #26263a;
  --text:      #e7e7f0;
  --muted:     #9a9ab5;
  --cyan:      #22e0ff;
  --blue:      #3b6bff;
  --violet:    #7a3bff;
  --accent:    #38b6ff;
  --grad:      linear-gradient(90deg, #22e0ff 0%, #3b6bff 45%, #7a3bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(34,224,255,.12), rgba(122,59,255,.12));
  --radius:    14px;
  --shadow:    0 8px 30px rgba(0,0,0,.45);
  --maxw:      1200px;

  /* Tokens SIEMPRE oscuros (cabecera y pie), no cambian con el tema */
  --d-header:  rgba(10,10,15,.85);
  --d-panel:   #12121c;
  --d-border:  #26263a;
  --d-text:    #e7e7f0;
  --d-muted:   #9a9ab5;
  --d-card:    #16161f;
  --d-cyan:    #22e0ff;
  --d-accent:  #38b6ff;
}

/* ---------------------------- TEMA CLARO -------------------------- */
/* Solo cambia el contenido; cabecera y pie siguen usando tokens --d-*. */
:root[data-theme="light"] {
  --bg:        #f3f4f9;
  --bg-2:      #e8eaf2;
  --card:      #ffffff;
  --card-2:    #eef0f6;
  --border:    #d7dae6;
  --text:      #1b1c2a;
  --muted:     #5b5c72;
  --cyan:      #0e8ba0;   /* teal más oscuro para contraste sobre fondo claro */
  --accent:    #2563eb;   /* enlaces azul más oscuro */
  --grad-soft: linear-gradient(135deg, rgba(34,224,255,.14), rgba(122,59,255,.12));
  --shadow:    0 10px 30px rgba(30,40,80,.14);
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(59,107,255,.10), transparent 60%),
    var(--bg);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(59,107,255,.15), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------ header ---------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--d-header);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--d-border);
}
.header-inner { display: flex; align-items: center; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--d-text); }
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 46px; width: auto;
  filter: drop-shadow(0 0 10px rgba(59,107,255,.5));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; font-size: 20px; }
.brand-cyber { color: var(--cyan); }
.brand-friends { color: var(--violet); }
.brand-text small { font-weight: 400; font-size: 11px; color: var(--d-muted); letter-spacing: .3px; margin-top: 3px; text-transform: lowercase; }

/* ------------------------------ presentación ---------------------- */
.intro {
  margin: 34px 0 22px;
  padding: 26px 28px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.intro-title {
  margin: 0 0 12px;
  font-size: 26px; line-height: 1.2;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.intro p { margin: 0 0 8px; color: var(--text); }
.intro p:last-child { margin-bottom: 0; }
.intro-sub { color: var(--text); font-size: 19px; line-height: 1.6; margin-top: 6px; }

/* ------------------------------ controles ------------------------- */
.controls {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin: 22px 0 18px;
}
.search-box {
  position: relative; flex: 1 1 380px; display: flex; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 0 14px; transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,107,255,.2);
}
.search-ico { color: var(--muted); flex: none; }
.search-box input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--text); font-size: 16px; padding: 14px 10px;
}
.search-box input::placeholder { color: var(--muted); }
.clear-btn {
  background: transparent; border: 0; color: var(--muted);
  font-size: 24px; cursor: pointer; line-height: 1; padding: 0 6px;
}
.clear-btn:hover { color: var(--text); }

.filters select {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 13px 18px; font-size: 15px; cursor: pointer; outline: 0;
}
.filters select:focus { border-color: var(--blue); }

/* ------------------------------ pestañas (menú fijo) -------------- */
.tabbar {
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: var(--header-h, 72px); z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px; padding-top: 6px;
}
.tabs {
  display: flex; gap: 2px; flex: 1; min-width: 0;
  overflow-x: auto; overflow-y: hidden;   /* evita la barra vertical fantasma */
  scrollbar-width: none;                   /* Firefox: sin barra */
}
.tabs::-webkit-scrollbar { display: none; } /* Chrome/Safari: sin barra */
.tab {
  position: relative;
  background: transparent; color: var(--muted);
  border: 0; border-radius: 8px 8px 0 0;
  padding: 12px 16px; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); background: var(--card); }
.tab.is-active { color: var(--text); font-weight: 600; }
.tab.is-active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 3px; border-radius: 3px 3px 0 0; background: var(--grad);
}
/* Sin contorno al pulsar con el ratón; se mantiene solo para teclado (accesibilidad) */
.tab:focus { outline: none; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 8px; }

/* ------------------------------ estado ---------------------------- */
.status { color: var(--muted); font-size: 14px; margin: 6px 2px 18px; min-height: 20px; }
.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  background: var(--grad-soft); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 17px;
}

/* ------------------------------ bloques --------------------------- */
.blocks { display: flex; flex-direction: column; gap: 40px; }
.block { scroll-margin-top: 90px; }
.block-head {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.block-title {
  margin: 0; font-size: 22px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.block-icon { font-size: 20px; }
.block-count {
  font-size: 13px; font-weight: 600; color: var(--cyan);
  background: rgba(34,224,255,.1); border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 999px;
}

/* ------------------------------ grid ------------------------------ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--blue);
  box-shadow: var(--shadow);
}
/* Fondo claro NEUTRO fijo (no cambia con el tema): los logos con
   transparencia se ven igual en claro y oscuro, y no "desaparecen". */
.card-media { position: relative; display: block; aspect-ratio: 16 / 9; background: #f2f3f7; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
/* Imágenes manuales: se muestran ENTERAS (contain) sobre el fondo neutro,
   sin marco: las de 16:9 llenan de borde a borde; los logos con otra
   proporción muestran solo el fondo neutro justo donde no llegan. */
.card-media img.fit-contain { object-fit: contain; }
.card:hover .card-media img { transform: scale(1.05); }
.card-chip {
  position: absolute; left: 10px; top: 10px;
  background: rgba(10,10,15,.82); color: #fff; backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
}
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { margin: 0; font-size: 17px; line-height: 1.3; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--cyan); text-decoration: none; }
.card-host { margin: 0; font-size: 12px; color: var(--accent); }
.card-comment { margin: 0; font-size: 14px; color: var(--muted); }
.card-fresh {
  display: block; font-size: 13px; color: var(--text);
  background: var(--grad-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; margin-top: 4px;
}
.card-fresh:hover { text-decoration: none; border-color: var(--blue); }
.fresh-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 8px var(--cyan); margin-right: 6px;
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.fresh-label { color: var(--cyan); font-weight: 600; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.tag {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; cursor: pointer; transition: all .15s;
}
.tag:hover { color: #fff; border-color: var(--violet); background: rgba(122,59,255,.15); }

/* ------------------------------ cargar más ------------------------ */
.sentinel { height: 1px; }
.load-more-wrap { text-align: center; margin: 30px 0; }
.btn-more {
  background: var(--grad); color: #fff; border: 0; cursor: pointer;
  padding: 12px 28px; border-radius: 999px; font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(59,107,255,.35);
}
.btn-more:hover { filter: brightness(1.1); }

/* ------------------------------ footer (siempre oscuro) ----------- */
.site-footer {
  margin-top: 60px; border-top: 1px solid var(--d-border);
  background: var(--d-panel); padding: 30px 0; color: var(--d-muted);
}
.footer-inner { text-align: center; color: var(--d-muted); font-size: 14px; }
.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.footer-links a { color: var(--d-accent); }
.footer-contact { margin: 10px 0 0; }
.footer-contact a { color: var(--d-cyan); font-weight: 600; }
.tiny { font-size: 12px; opacity: .8; }

/* ------------------------------ botón de tema --------------------- */
.theme-toggle {
  align-self: center; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--blue); }
.theme-toggle:focus { outline: none; }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-ico { font-size: 15px; line-height: 1; }
.theme-ico-moon { display: none; }
:root[data-theme="light"] .theme-ico-sun { display: none; }
:root[data-theme="light"] .theme-ico-moon { display: inline; }

/* ------------------------------ sobre (cabecera) ------------------ */
.mailbox {
  margin-left: auto; display: inline-flex; flex-direction: column; align-items: center;
  gap: 2px; color: var(--d-muted); text-decoration: none; padding: 4px 6px;
  border-radius: 12px; transition: background .2s;
}
.mailbox:hover { background: var(--d-card); text-decoration: none; }
.mailbox-label { font-size: 11px; letter-spacing: .3px; }
.mailbox:hover .mailbox-label { color: var(--d-cyan); }
.mb-invader { transform-origin: 50% 100%; animation: mb-bob 2.6s ease-in-out infinite; }
@keyframes mb-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
.mailbox:hover .mb-invader { animation: mb-wave .5s ease-in-out infinite; }
@keyframes mb-wave { 0%,100% { transform: translateY(-3px) rotate(-5deg); } 50% { transform: translateY(-3px) rotate(5deg); } }

/* ------------------------------ contacto -------------------------- */
.contact {
  border-top: 1px solid var(--border);
  background:
    radial-gradient(900px 400px at 50% 0, rgba(122,59,255,.12), transparent 60%),
    var(--bg-2);
  padding: 50px 0; margin-top: 60px; scroll-margin-top: 90px;
}
.contact-inner { max-width: 720px; }
.contact-head { text-align: center; margin-bottom: 26px; }
.contact-head h2 {
  margin: 0 0 8px; font-size: 28px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.contact-head .wave { -webkit-text-fill-color: initial; display: inline-block; animation: mb-bob 2s ease-in-out infinite; }
.contact-head p { color: var(--muted); margin: 0; }

.contact-form {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cf-field { display: flex; flex-direction: column; gap: 6px; }
.cf-field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.contact-form input, .contact-form textarea {
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 12px 13px; font-size: 15px; font-family: inherit; width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 0; border-color: var(--blue); }
.contact-form textarea { resize: vertical; }
/* obligatorios e inválidos (solo tras interactuar) */
.req { color: #ff6b81; font-weight: 700; }
.contact-form input:user-invalid,
.contact-form textarea:user-invalid { border-color: #ff6b81; }
.contact-form input:user-invalid:focus,
.contact-form textarea:user-invalid:focus { box-shadow: 0 0 0 3px rgba(255,107,129,.18); }
.cf-note { font-size: 12px; color: var(--muted); margin: -4px 0 2px; }
.cf-captcha { max-width: 320px; }
.cf-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.cf-consent input { width: auto; margin-top: 3px; }
.cf-consent a { color: var(--accent); }
.cf-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn-send {
  background: var(--grad); color: #fff; border: 0; cursor: pointer;
  padding: 13px 30px; border-radius: 999px; font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(59,107,255,.35);
}
.btn-send:hover { filter: brightness(1.1); }
.btn-send:disabled { opacity: .6; cursor: default; }
.cf-msg { font-size: 14px; }
.cf-msg.ok { color: #4ade80; }
.cf-msg.err { color: #ff6b81; }
/* honeypot: oculto para humanos, visible para bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------ aviso sin cookies (popup) --------- */
.cn-backdrop {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(6, 6, 12, .72); backdrop-filter: blur(4px);
  animation: cn-fade .25s ease;
}
.cn-backdrop[hidden] { display: none; }
@keyframes cn-fade { from { opacity: 0; } to { opacity: 1; } }
.cn-modal {
  width: 100%; max-width: 460px; text-align: center;
  background: var(--d-panel); color: var(--d-text);
  border: 1px solid var(--d-border); border-radius: 18px;
  padding: 36px 32px 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  animation: cn-pop .3s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes cn-pop { from { transform: translateY(12px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.cn-title { margin: 0 0 16px; font-size: 21px; line-height: 1.4; color: var(--d-muted); }
.cn-title strong { color: var(--d-text); }
.cn-more { margin: 0 0 18px; }
.cn-more a { color: var(--d-cyan); font-weight: 600; font-size: 15px; }
.cn-invaders {
  margin: 0 0 24px; font-size: 30px; letter-spacing: 8px;
  animation: cn-bob 2.4s ease-in-out infinite;
}
@keyframes cn-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.cn-btn {
  background: var(--grad); color: #fff; border: 0; cursor: pointer;
  padding: 12px 34px; border-radius: 999px; font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(59,107,255,.4);
}
.cn-btn:hover { filter: brightness(1.1); }

/* ------------------------------ responsive ------------------------ */
@media (max-width: 640px) {
  .brand-text small { display: none; }
  .grid { grid-template-columns: 1fr; }
  .controls { flex-direction: column; }
  .search-box { flex-basis: auto; }   /* evita que el buscador se estire en alto */

  /* Pestañas: se ven todas repartidas en varias filas (sin scroll horizontal) */
  .tabbar { align-items: flex-start; }
  .tabs { flex-wrap: wrap; overflow: visible; gap: 4px; }
  .tab { padding: 9px 12px; font-size: 14px; }
  .cf-row { grid-template-columns: 1fr; }
  .mailbox-label { display: none; }
  .cn-modal { padding: 30px 22px 26px; }
  .cn-title { font-size: 19px; }
}
