/* ============================================================
   RODRIGO VILA IT — Modern Cybersecurity Portfolio
   Paleta: Azul eléctrico / Gris oscuro corporativo
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --blue-primary:   #0A84FF;
  --blue-bright:    #38BFFF;
  --blue-dim:       #0048A8;
  --blue-glow:      rgba(10,132,255,0.25);
  --accent-cyan:    #00E5FF;
  --bg-void:        #050A0F;
  --bg-dark:        #080E18;
  --bg-panel:       #0D1520;
  --bg-panel2:      #101C2C;
  --bg-card:        #0F1A28;
  --border-subtle:  rgba(10,132,255,0.18);
  --border-bright:  rgba(10,132,255,0.55);
  --text-primary:   #E8F4FF;
  --text-secondary: #8BACC8;
  --text-muted:     #4A6880;
  --text-mono:      #38BFFF;
  --nav-height:     64px;
  --sidebar-width:  220px;
  --radius:         6px;
  --transition:     all 0.22s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.65;
}

/* ── GRID BG ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(10,132,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,132,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── NOISE OVERLAY ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--blue-bright); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-cyan); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--blue-dim); border-radius: 3px; }

/* ============================================================
   TOP NAV
   ============================================================ */
#topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(5,10,15,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 1000;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo-icon {
  width: 36px; height: 36px;
  border: 1.5px solid var(--blue-primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,132,255,0.08);
  position: relative;
  overflow: hidden;
}
.nav-logo-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(10,132,255,0.3) 100%);
}
.nav-logo-icon svg { width: 20px; height: 20px; color: var(--blue-bright); z-index:1; }

.nav-brand-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}
.nav-brand-text span { color: var(--blue-primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: var(--transition);
  position: relative;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--blue-bright);
  background: rgba(10,132,255,0.1);
  border-color: var(--border-subtle);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 14px; right: 14px;
  height: 2px;
  background: var(--blue-primary);
  border-radius: 1px;
}

/* Status indicator */
.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.status-dot {
  width: 7px; height: 7px;
  background: #22C55E;
  border-radius: 50%;
  box-shadow: 0 0 6px #22C55E;
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; box-shadow: 0 0 6px #22C55E; }
  50%      { opacity: 0.6; box-shadow: 0 0 12px #22C55E; }
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
#page-wrap {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding-top: var(--nav-height);
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}

/* ============================================================
   HERO BANNER
   ============================================================ */
#hero {
  grid-column: 1 / -1;
  padding: 60px 40px 50px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

#hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(10,132,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}
#hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 30%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,229,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--blue-primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-label::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--blue-primary);
}

#hero h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 16px;
}
#hero h1 .highlight {
  color: var(--blue-primary);
  position: relative;
}

.hero-slogan {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  color: var(--text-mono);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-slogan::before { content: '> '; color: var(--blue-primary); }

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  padding: 4px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--text-secondary);
  background: rgba(10,132,255,0.05);
  letter-spacing: 0.08em;
}
.hero-tag.accent {
  border-color: var(--blue-primary);
  color: var(--blue-bright);
  background: rgba(10,132,255,0.12);
}

/* ============================================================
   SIDEBARS
   ============================================================ */
#sidebar-left,
#sidebar-right {
  padding: 32px 16px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
#sidebar-right {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

/* Panel / Widget */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}
.panel:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 20px rgba(10,132,255,0.08);
}

.panel-header {
  padding: 10px 14px;
  background: rgba(10,132,255,0.08);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-header-dot {
  width: 6px; height: 6px;
  background: var(--blue-primary);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--blue-primary);
}
.panel-header-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-bright);
}

.panel-body { padding: 12px; }

/* Nav links in panels */
.panel-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: var(--transition);
  border: 1px solid transparent;
}
.panel-nav a::before {
  content: '//';
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--blue-dim);
  transition: var(--transition);
}
.panel-nav a:hover,
.panel-nav a.active {
  color: var(--blue-bright);
  background: rgba(10,132,255,0.1);
  border-color: var(--border-subtle);
  padding-left: 14px;
}
.panel-nav a:hover::before,
.panel-nav a.active::before { color: var(--blue-primary); }

/* External links in panels */
.panel-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  margin-bottom: 2px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: var(--transition);
}
.panel-links a::after { content: '↗'; font-size: 10px; opacity: 0.5; }
.panel-links a:hover {
  color: var(--accent-cyan);
  background: rgba(0,229,255,0.06);
  border-color: rgba(0,229,255,0.2);
}

/* Badge image panels */
.badge-panel img {
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.badge-panel a:hover img {
  border-color: var(--blue-primary);
  box-shadow: 0 0 12px var(--blue-glow);
}

/* Giphy → replaced with terminal animation */
.terminal-widget {
  background: #050A0F;
  border-radius: 4px;
  padding: 12px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-mono);
  min-height: 100px;
  overflow: hidden;
}
.terminal-line { margin-bottom: 3px; opacity: 0; animation: fadeIn 0.3s forwards; }
.terminal-line.cmd { color: var(--blue-bright); }
.terminal-line.ok  { color: #22C55E; }
.terminal-line.warn{ color: #F59E0B; }
.terminal-line.err { color: #EF4444; }
.terminal-cursor { display: inline-block; width: 7px; height: 13px; background: var(--blue-bright); animation: blink 1s step-end infinite; vertical-align: text-bottom; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes fadeIn { to{opacity:1} }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#main-content {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── CARD ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 32px rgba(10,132,255,0.1);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(10,132,255,0.06);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
}
.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-icon {
  width: 32px; height: 32px;
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,132,255,0.1);
  flex-shrink: 0;
}
.card-icon svg { width: 16px; height: 16px; color: var(--blue-bright); }

.card-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}
.card-id {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
}

.card-toggle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--blue-primary);
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}
.card-toggle:hover {
  background: rgba(10,132,255,0.1);
  border-color: var(--blue-primary);
  color: var(--blue-bright);
}

.card-body {
  padding: 20px;
  display: none;
}
.card-body.open { display: block; }

/* Static card (no collapsible) */
.card-body-static { padding: 20px; }

/* Typography inside cards */
.card-body p,
.card-body-static p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.7;
}
.card-body p:last-child,
.card-body-static p:last-child { margin-bottom: 0; }

.card-body h2,
.card-body-static h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.card-body h2:first-child,
.card-body-static h2:first-child { margin-top: 0; }

/* File list */
.file-list { display: flex; flex-direction: column; gap: 4px; }
.file-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(10,132,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: var(--transition);
}
.file-list a::before {
  content: '📄';
  font-size: 12px;
  flex-shrink: 0;
}
.file-list a:hover {
  color: var(--blue-bright);
  background: rgba(10,132,255,0.1);
  border-color: var(--border-bright);
  padding-left: 18px;
}

/* Warning block */
.warn-block {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 4px;
  padding: 12px 16px;
  margin: 12px 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: #F59E0B;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.warn-block::before { content: '⚠'; flex-shrink:0; }

/* Cert grid */
.cert-grid { display: flex; flex-direction: column; gap: 20px; }
.cert-item {}
.cert-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--blue-primary);
}
.cert-item img {
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.cert-item img:hover {
  border-color: var(--blue-primary);
  box-shadow: 0 0 16px var(--blue-glow);
}
.cert-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* Project image */
.project-img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  margin: 14px 0;
  transition: var(--transition);
}
.project-img:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 20px rgba(10,132,255,0.12);
}

/* Section divider */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-dim), transparent);
  margin: 8px 0 20px;
}

/* Collapse toggle link */
.collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--blue-primary);
  margin-top: 16px;
  padding: 5px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  transition: var(--transition);
}
.collapse-btn:hover {
  color: var(--blue-bright);
  background: rgba(10,132,255,0.1);
  border-color: var(--blue-primary);
}

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-subtle);
  background: rgba(5,10,15,0.7);
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.footer-copy span { color: var(--blue-dim); }

.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  transition: var(--transition);
}
.footer-links a:hover { color: var(--blue-bright); }

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-method {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(10,132,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: var(--transition);
}
.contact-method:hover {
  border-color: var(--border-bright);
  background: rgba(10,132,255,0.1);
}
.contact-icon {
  width: 42px; height: 42px;
  background: rgba(10,132,255,0.12);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.contact-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.contact-value {
  font-size: 14px;
  color: var(--text-primary);
}
.contact-value a { color: var(--blue-bright); }
.contact-value a:hover { color: var(--accent-cyan); }

/* ============================================================
   PAGE INTRO (archivos / proyectos)
   ============================================================ */
.page-intro {
  grid-column: 1 / -1;
  padding: 40px 40px 24px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}
.page-intro-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--blue-primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.page-intro h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}
.page-intro h1 .highlight { color: var(--blue-primary); }

/* ============================================================
   HERO SCAN LINE ANIMATION
   ============================================================ */
.scanline-box {
  position: absolute;
  right: 40px; top: 50%;
  transform: translateY(-50%);
  width: 200px; height: 160px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
}
@media (min-width: 900px) { .scanline-box { display: block; } }
.scanline-inner {
  position: relative;
  width: 100%; height: 100%;
  background: linear-gradient(180deg, rgba(10,132,255,0.03) 0%, rgba(10,132,255,0.08) 100%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: rgba(10,132,255,0.6);
  padding: 10px;
  overflow: hidden;
}
.scanline-inner::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: rgba(56,191,255,0.4);
  animation: scan 2.5s linear infinite;
}
@keyframes scan {
  0%   { top: 0; }
  100% { top: 100%; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  #page-wrap {
    grid-template-columns: 1fr;
  }
  #sidebar-left,
  #sidebar-right {
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px;
    flex-direction: row;
    flex-wrap: wrap;
  }
  #sidebar-left .panel,
  #sidebar-right .panel { flex: 1 1 200px; }
  #main-content { padding: 20px 16px; }
  #hero { padding: 40px 20px 32px; }
  .page-intro { padding: 30px 20px 20px; }
  #footer { padding: 20px; flex-direction: column; align-items: flex-start; }
  #topnav { padding: 0 16px; }
  .nav-status { display: none; }
  .nav-links a { padding: 5px 10px; font-size: 12px; }
}

/* ============================================================
   ENTRY ANIMATIONS
   ============================================================ */
@keyframes slideUp {
  from { opacity:0; transform: translateY(20px); }
  to   { opacity:1; transform: translateY(0); }
}
.card, .panel, .contact-method {
  animation: slideUp 0.4s ease both;
}
.card:nth-child(1)  { animation-delay: 0.05s; }
.card:nth-child(2)  { animation-delay: 0.10s; }
.card:nth-child(3)  { animation-delay: 0.15s; }
.card:nth-child(4)  { animation-delay: 0.20s; }
.card:nth-child(5)  { animation-delay: 0.25s; }
