/* ============================================================
   CyberSec4You — hoja de estilos compartida
   Estética: dark mode tipo terminal, minimalista
   ============================================================ */

:root {
  --bg: #0b1120;
  --panel: #111a2e;
  --border: #1f2b45;
  --text: #e5e9f0;
  --muted: #8b96ad;
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.12);
  --warning: #f5a623;
  --error: #ef4444;

  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --maxw: 1080px;
  --radius: 10px;
}

/* ---------- Reset básico ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Contenedor ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Utilidades ---------- */
.accent {
  color: var(--accent);
}
.muted {
  color: var(--muted);
}
.mono-tag {
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ============================================================
   Header / Navegación
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text);
  margin: 4px 0;
  transition: transform 0.2s ease;
}

/* ============================================================
   Secciones genéricas
   ============================================================ */
.section {
  padding: 4rem 0;
}

.section-sm {
  padding: 2.5rem 0;
}

.section-title {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.section-sub {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 5.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
}

.hero .mono-tag {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background-color: var(--accent-dim);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  max-width: 20ch;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.hero p {
  color: var(--muted);
  max-width: 60ch;
  font-size: 1.02rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent);
  color: #04211d;
  border-color: var(--accent);
  font-weight: 500;
}

.btn-primary:hover {
  background-color: #5ee6d6;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   Grid de tarjetas
   ============================================================ */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Tarjeta ---------- */
.card {
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.card .card-cat {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.55rem;
}

.card .card-date {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

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

.card .card-link {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--accent);
}

/* Tarjeta como enlace completo */
a.card {
  color: inherit;
}
a.card:hover {
  text-decoration: none;
}

/* ============================================================
   Artículo (posts del blog)
   ============================================================ */
.article {
  padding: 3.5rem 0;
}

.article-header {
  max-width: 760px;
  margin: 0 auto 2.5rem;
}

.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0.75rem 0 0.75rem;
  text-wrap: balance;
}

.article-header .card-date {
  color: var(--muted);
  font-size: 0.85rem;
}

.article-body {
  max-width: 760px;
  margin: 0 auto;
}

.article-body h2 {
  font-size: 1.35rem;
  margin: 2.25rem 0 0.85rem;
  padding-top: 0.5rem;
}

.article-body h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.6rem;
}

.article-body p {
  margin-bottom: 1.1rem;
  color: var(--text);
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.1rem 1.4rem;
  color: var(--text);
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body a {
  text-decoration: underline;
}

/* ---------- Bloques de código ---------- */
.article-body pre {
  background-color: #060a14;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.4rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.article-body pre code {
  color: #cfe9e4;
  white-space: pre;
}

.article-body :not(pre) > code {
  background-color: var(--accent-dim);
  color: var(--accent);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}

.article-figure {
  margin: 0 0 1.6rem;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #060a14;
}

.article-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.figure-source {
  margin: -0.8rem 0 1.6rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 640px;
}

.data-table th,
.data-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table thead th {
  background-color: #060a14;
  color: var(--accent);
  font-family: var(--font-heading);
  font-weight: 500;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:nth-child(even) {
  background-color: rgba(45, 212, 191, 0.03);
}

.callout {
  border-left: 3px solid var(--warning);
  background-color: rgba(245, 166, 35, 0.08);
  padding: 0.9rem 1.1rem;
  border-radius: 0 8px 8px 0;
  margin: 0 0 1.4rem;
  font-size: 0.9rem;
  color: var(--text);
}

.callout-quote {
  border-left-color: var(--accent);
  background-color: rgba(45, 212, 191, 0.07);
  font-style: italic;
}

.callout-quote p {
  margin: 0 0 0.6rem;
}

.callout-quote p:last-child {
  margin-bottom: 0;
  font-style: normal;
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ============================================================
   Sobre mí
   ============================================================ */
.about-lead {
  font-size: 1.1rem;
  color: var(--text);
  max-width: 65ch;
  margin-bottom: 1.5rem;
}

.info-block {
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.info-block h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

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

.info-list li {
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
  font-size: 0.9rem;
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list li span {
  color: var(--muted);
}

/* ---------- Subtítulo del hero (rol profesional) ---------- */
.hero-role {
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--accent);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  margin-bottom: 1.25rem;
}

/* ---------- Chips de habilidades ---------- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.chip {
  font-size: 0.8rem;
  color: var(--text);
  background-color: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

/* ---------- Experiencia / trayectoria ---------- */
.role-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.role-meta strong {
  color: var(--accent);
  font-weight: 500;
}

.info-list.check li {
  padding-left: 1.25rem;
  position: relative;
}

.info-list.check li::before {
  content: "»";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Lista de contacto ---------- */
.contact-methods {
  list-style: none;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}

.contact-methods li {
  display: flex;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: var(--text);
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border);
}

.contact-methods li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.contact-methods .label {
  color: var(--muted);
  min-width: 90px;
}

/* ============================================================
   Contacto
   ============================================================ */
.contact-box {
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.contact-box h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.contact-box p {
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.contact-email {
  font-size: 1.05rem;
  word-break: break-all;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer p {
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.82rem;
}

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

/* ============================================================
   Responsive — menú móvil
   ============================================================ */
@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background-color: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.25rem 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
  }

  .nav-links.open {
    max-height: 320px;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }
}
