@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,700;0,9..144,900;1,9..144,300&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg:        #030B1A;
  --bg2:       #060F24;
  --bg3:       #0A1530;
  --blue:      #0045BF;
  --orange:    #FF6C2D;
  --cyan:      #66CFEB;
  --white:     #F0F4FF;
  --muted:     #4A5878;
  --border:    rgba(0,69,191,0.25);
  --font-head: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --max-w:     720px;
  --max-w-wide:1200px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ─── GRID BACKGROUND ─── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,69,191,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,69,191,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ─── NAVBAR ─── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3,11,26,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.navbar-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text .road {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.logo-text .cloudsec {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.logo-text .latam {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--orange);
  letter-spacing: 3px;
}

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

.navbar-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.navbar-links a:hover { color: var(--cyan); }

.navbar-links .nav-cta {
  background: var(--blue);
  color: var(--white) !important;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 12px;
  transition: background 0.2s !important;
}

.navbar-links .nav-cta:hover { background: #0052e0 !important; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all 0.3s;
}

/* ─── HERO ─── */
.hero {
  position: relative;
  z-index: 1;
  padding: 5rem 2rem 4rem;
  max-width: var(--max-w-wide);
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--cyan);
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
  max-width: 800px;
}

.hero h1 em {
  font-style: italic;
  color: var(--cyan);
}

.hero h1 .accent { color: var(--orange); }

.hero-sub {
  font-size: 1.1rem;
  color: rgba(240,244,255,0.6);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat .num {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
}

.hero-stat .label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ─── SECTION HEADERS ─── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
}

.section-header .section-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* ─── FEATURED POST ─── */
.featured-post {
  position: relative;
  z-index: 1;
  max-width: var(--max-w-wide);
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
  cursor: pointer;
}

.featured-card:hover {
  border-color: rgba(0,69,191,0.6);
  transform: translateY(-2px);
}

.featured-content {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.post-series {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--orange);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-series::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--orange);
}

.featured-title {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--white);
  text-decoration: none;
  display: block;
}

.featured-title:hover { color: var(--cyan); }

.post-excerpt {
  color: rgba(240,244,255,0.55);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  flex: 1;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.post-readtime {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.post-reactions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.reaction-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  transition: all 0.2s;
}

.reaction-btn:hover, .reaction-btn.active {
  border-color: var(--orange);
  color: var(--orange);
}

.reaction-btn.fav:hover, .reaction-btn.fav.active {
  border-color: var(--cyan);
  color: var(--cyan);
}

.featured-cover {
  position: relative;
  overflow: hidden;
  background: var(--bg3);
}

.featured-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.featured-card:hover .featured-cover img { transform: scale(1.03); }

.cover-placeholder {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg3) 0%, #0a2040 100%);
}

/* ─── POST GRID ─── */
.posts-section {
  position: relative;
  z-index: 1;
  max-width: var(--max-w-wide);
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.post-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: rgba(0,69,191,0.5);
  transform: translateY(-3px);
}

.post-card-cover {
  height: 180px;
  background: var(--bg3);
  overflow: hidden;
  position: relative;
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.post-card:hover .post-card-cover img { transform: scale(1.05); }

.post-card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg3), #0a2040);
}

.post-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-series {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--orange);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.post-card-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--white);
  text-decoration: none;
  display: block;
}

.post-card-title:hover { color: var(--cyan); }

.post-card-excerpt {
  font-size: 0.875rem;
  color: rgba(240,244,255,0.5);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.post-card-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-card-reactions {
  display: flex;
  gap: 8px;
}

.readers-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── TAGS FILTER ─── */
.tags-filter {
  position: relative;
  z-index: 1;
  max-width: var(--max-w-wide);
  margin: 0 auto 2rem;
  padding: 0 2rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}

.tag-btn:hover, .tag-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(102,207,235,0.05);
}

/* ─── SINGLE POST ─── */
.post-layout {
  position: relative;
  z-index: 1;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 4rem;
  align-items: start;
}

.post-header {
  margin-bottom: 3rem;
  grid-column: 1 / -1;
}

.post-header .post-series {
  margin-bottom: 1.5rem;
}

.post-header h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
}

.post-header-meta {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.post-cover {
  grid-column: 1 / -1;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.post-cover img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── PROSE ─── */
.post-content {
  min-width: 0;
}

.prose h2 {
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 700;
  margin: 3rem 0 1rem;
  color: var(--white);
  position: relative;
  padding-left: 1rem;
}

.prose h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  background: linear-gradient(to bottom, var(--orange), var(--blue));
  border-radius: 2px;
}

.prose h3 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--cyan);
}

.prose p {
  margin-bottom: 1.5rem;
  color: rgba(240,244,255,0.85);
}

.prose strong { color: var(--white); }

.prose em { color: var(--cyan); font-style: italic; }

.prose a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(102,207,235,0.3);
  transition: border-color 0.2s;
}

.prose a:hover { border-color: var(--cyan); }

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.prose li {
  color: rgba(240,244,255,0.8);
  margin-bottom: 0.5rem;
}

.prose li::marker { color: var(--orange); }

.prose blockquote {
  border-left: 3px solid var(--orange);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: rgba(255,108,45,0.05);
  border-radius: 0 6px 6px 0;
}

.prose blockquote p { color: rgba(240,244,255,0.7); margin: 0; }

.prose pre {
  background: #060F24;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  position: relative;
}

.prose pre::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--cyan);
}

.prose pre code {
  color: rgba(240,244,255,0.88);
  font-size: 0.875rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}

.prose th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0,69,191,0.1);
  color: rgba(240,244,255,0.75);
}

.prose tr:hover td { background: rgba(0,69,191,0.05); }

.prose img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 2rem 0;
}

/* ─── SIDEBAR ─── */
.post-sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-widget {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.sidebar-widget h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-list a {
  font-size: 0.85rem;
  color: rgba(240,244,255,0.55);
  text-decoration: none;
  transition: color 0.2s;
  display: block;
  padding: 2px 0;
}

.toc-list a:hover, .toc-list a.active { color: var(--cyan); }

.post-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.action-btn:hover { border-color: var(--orange); color: var(--orange); }
.action-btn.active { border-color: var(--orange); color: var(--orange); background: rgba(255,108,45,0.05); }
.action-btn.fav:hover, .action-btn.fav.active { border-color: var(--cyan); color: var(--cyan); background: rgba(102,207,235,0.05); }

.action-count {
  margin-left: auto;
  background: var(--bg3);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
}

/* ─── COMMENTS ─── */
.comments-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.comments-section h3 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* ─── AUTHOR BIO ─── */
.author-bio {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;          /* ← agregar esto */
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--white);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.author-info h4 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.author-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--orange);
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.author-info p {
  font-size: 0.9rem;
  color: rgba(240,244,255,0.6);
  line-height: 1.6;
}

.author-links {
  display: flex;
  gap: 12px;
  margin-top: 0.75rem;
}

.author-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  text-decoration: none;
}

.author-links a:hover { color: var(--orange); }

/* ─── FOOTER ─── */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--cyan); }

/* ─── ACCENTS & DECORATIONS ─── */
.glow-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  margin-right: 8px;
}

.cyan-dot {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

/* ─── READING PROGRESS ─── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(to right, var(--blue), var(--cyan), var(--orange));
  z-index: 200;
  transition: width 0.1s;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.6s ease forwards; }
.fade-up-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-up-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-up-delay-3 { animation-delay: 0.3s; opacity: 0; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .featured-card { grid-template-columns: 1fr; }
  .featured-cover { height: 220px; }
  .post-layout { grid-template-columns: 1fr; }
  .post-header { grid-column: 1; }
  .post-cover { grid-column: 1; }
  .post-sidebar { position: static; }
}

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

@media (max-width: 640px) {
  .navbar-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: rgba(3,11,26,0.98); padding: 1.5rem 2rem; border-bottom: 1px solid var(--border); }
  .navbar-links.open { display: flex; }
  .hamburger { display: flex; }
  .posts-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .hero-stats { gap: 1.5rem; }
  .author-bio { flex-direction: column; }
  .footer-inner { flex-direction: column; text-align: center; }
}