/* =========================================================================
   VARIABLES GLOBALES (Grid Minimalist Theme)
   ========================================================================= */
:root {
  --bg-dark: #08080a;
  --bg-card: rgba(255, 255, 255, 0.02);
  --border-color: rgba(255, 255, 255, 0.08);

  --text-primary: #ffffff;
  --text-secondary: #9aa0a6;
  --text-muted: #5f6368;

  --accent-blue: #5c8aff;
  --accent-blue-dim: rgba(92, 138, 255, 0.2);
  --accent-purple: #8f6cf8;

  --badge-earned: #e8eaed;
  --badge-earned-bg: rgba(232, 234, 237, 0.1);
  --badge-progress: #fbbc04;
  --badge-progress-bg: rgba(251, 188, 4, 0.1);
  --badge-planned: #f28b82;
  --badge-planned-bg: rgba(242, 139, 130, 0.1);

  --font-heading: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --transition: all 0.2s ease;
}

/* =========================================================================
   RESETEOS BÃSICOS
   ========================================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================================
   BACKGROUND GRID & CANVAS
   ========================================================================= */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background-color: var(--bg-dark);
  pointer-events: none;
  overflow: hidden;
}

.grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* =========================================================================
   TIPOGRAFÃA GENERAL
   ========================================================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.03em;
}

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

p {
  color: var(--text-secondary);
}

/* =========================================================================
   NAVEGACIÃ“N
   ========================================================================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.nav-brand a {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 1rem;
}

.accent-dot {
  color: var(--accent-blue);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.btn-nav {
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 6px;
  color: var(--text-secondary);
}

.btn-nav:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* =========================================================================
   ESTRUCTURA BÃSICA
   ========================================================================= */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px;
}

.block {
  padding: 100px 0;
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.05;
  margin-bottom: 60px;
  text-align: center;
  position: relative;
  cursor: default;
}

.section-title:hover {
  animation: micro-glitch 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes micro-glitch {
  0% {
    transform: translate(0);
    text-shadow: none;
  }

  20% {
    transform: translate(-2px, 1px);
    text-shadow:
      2px 0 var(--accent-blue),
      -2px 0 var(--accent-purple);
  }

  40% {
    transform: translate(2px, -1px);
    text-shadow:
      -2px 0 var(--accent-blue),
      2px 0 var(--accent-purple);
  }

  60% {
    transform: translate(-1px, -1px);
  }

  80% {
    transform: translate(1px, 1px);
  }

  100% {
    transform: translate(0);
    text-shadow: none;
  }
}

.section-tag {
  font-family: var(--font-mono);
  color: var(--accent-blue);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  display: block;
  margin: 0 auto 16px;
  font-weight: 700;
  text-align: center;
}

/* =========================================================================
   BLOQUE 1: HERO
   ========================================================================= */
.hero-section {
  text-align: center;
  padding-top: 80px;
}

.remote-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-blue);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(92, 138, 255, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(92, 138, 255, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(92, 138, 255, 0);
  }
}

.hero-title {
  font-size: clamp(4rem, 8vw, 7rem);
  line-height: 1;
  margin-bottom: 24px;
}

.hologram-text {
  position: relative;
  color: #fff;
  text-shadow:
    1px 0px 1px rgba(0, 255, 255, 0.4),
    -1px 0px 1px rgba(255, 0, 255, 0.4);
  animation: hologram-flicker 3s infinite linear;
  will-change: text-shadow, transform;
}

@keyframes hologram-flicker {
  0% {
    text-shadow:
      1px 0px 1px rgba(0, 255, 255, 0.4),
      -1px 0px 1px rgba(255, 0, 255, 0.4);
  }

  5% {
    text-shadow:
      2px 0px 2px rgba(0, 255, 255, 0.4),
      -2px 0px 2px rgba(255, 0, 255, 0.4);
  }

  10% {
    text-shadow:
      1px 0px 1px rgba(0, 255, 255, 0.4),
      -1px 0px 1px rgba(255, 0, 255, 0.4);
  }

  15% {
    text-shadow:
      0.5px 0px 0.5px rgba(0, 255, 255, 0.4),
      -0.5px 0px 0.5px rgba(255, 0, 255, 0.4);
  }

  20% {
    text-shadow:
      1.5px 0px 1.5px rgba(0, 255, 255, 0.4),
      -1.5px 0px 1.5px rgba(255, 0, 255, 0.4);
  }

  100% {
    text-shadow:
      1px 0px 1px rgba(0, 255, 255, 0.4),
      -1px 0px 1px rgba(255, 0, 255, 0.4);
  }
}

.accent-square {
  display: inline-block;
  width: clamp(12px, 2vw, 24px);
  height: clamp(12px, 2vw, 24px);
  background-color: var(--accent-blue);
  margin-left: 8px;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 80px;
}

.btn {
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-dark);
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-card);
}

/* Metrics Grid in Hero */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.metric-item {
  padding: 30px 0;
  border-right: 1px solid var(--border-color);
}

.metric-item:last-child {
  border-right: none;
}

.metric-value {
  font-size: 2rem;
  margin-bottom: 4px;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* =========================================================================
   BLOQUE 2: EXPERIENCE
   ========================================================================= */
.timeline {
  border-top: 1px solid var(--border-color);
  max-width: 800px;
  margin: 0 auto;
}

.timeline-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  padding: 40px 0;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  padding: 30px;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.timeline-company {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-blue);
}

.timeline-role {
  font-size: 1.25rem;
  margin-bottom: 20px;
}

.timeline-tasks {
  list-style: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.timeline-tasks li {
  margin-bottom: 12px;
  position: relative;
  padding-left: 20px;
}

.timeline-tasks li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.timeline-divider {
  height: 1px;
  background-color: var(--border-color);
}

/* =========================================================================
   BLOQUE 3: ABOUT
   ========================================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  margin: 0 auto;
  max-width: 900px;
}

.about-description p {
  margin-bottom: 24px;
  font-size: 1.05rem;
}

.about-cards-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 50px;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.card-icon {
  width: 40px;
  height: 40px;
  background-color: var(--bg-card);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent-purple);
}

.card-info {
  display: flex;
  flex-direction: column;
}

.card-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

.card-val {
  font-size: 0.9rem;
  font-weight: 500;
}

/* =========================================================================
   BLOQUE 4: SKILLS & CERTS
   ========================================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  margin: 0 auto;
  max-width: 900px;
}

.skills-lists-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.category-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-blue);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}

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

.clean-list li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.clean-list li i {
  color: var(--accent-blue);
  font-size: 1.15rem;
}

.certs-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cert-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-card);
}

.cert-info {
  display: flex;
  flex-direction: column;
}

.cert-name {
  font-size: 1rem;
  font-weight: 500;
}

.cert-issuer {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.cert-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.badge-earned {
  background-color: var(--badge-earned-bg);
  color: var(--badge-earned);
}

.badge-progress {
  background-color: var(--badge-progress-bg);
  color: var(--badge-progress);
}

.badge-planned {
  background-color: var(--badge-planned-bg);
  color: var(--badge-planned);
}

.cert-footer {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
}

/* =========================================================================
   BLOQUE 5: CONTACT & PGP
   ========================================================================= */
.contact-section {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 200px;
}

.contact-desc {
  font-size: 1.05rem;
  margin: 0 auto 40px;
  line-height: 1.6;
  max-width: 600px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.contact-card:hover {
  background-color: var(--bg-card);
  border-color: var(--text-secondary);
}

.contact-links {
  text-align: left;
}

.contact-card-left {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 500;
}

.contact-card-left i {
  font-size: 1.2rem;
}

.icon-arrow {
  color: var(--text-muted);
}

.icon-envelope {
  color: #e8eaed;
}

.icon-briefcase {
  color: #d99a71;
}

.icon-target {
  color: #ff5277;
}

.icon-github {
  color: #e8eaed;
}

.contact-links-container {
  max-width: 600px;
  margin: 0 auto;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

/* =========================================================================
   BLOQUE: PROJECTS (New)
   ========================================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
}

.project-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  border-color: var(--accent-blue-dim);
}

/* Efecto Glow DinÃ¡mico */
.project-card::before,
.info-card::before,
.cert-card::before,
.contact-card::before,
.timeline-item::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    350px circle at var(--mouse-x) var(--mouse-y),
    rgba(92, 138, 255, 0.12),
    transparent 80%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: background, opacity;
}

.project-card:hover::before,
.info-card:hover::before,
.cert-card:hover::before,
.contact-card:hover::before,
.timeline-item:hover::before {
  opacity: 1;
}

.project-header,
.project-title,
.project-desc,
.project-tech,
.timeline-meta,
.timeline-content,
.card-icon,
.card-info,
.cert-info,
.cert-badge {
  position: relative;
  z-index: 1;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.icon-folder {
  font-size: 2.5rem;
  color: var(--accent-blue);
}

.project-links a {
  color: var(--text-muted);
  font-size: 1.4rem;
  margin-left: 12px;
}

.project-links a:hover {
  color: var(--accent-blue);
}

.project-title {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.project-desc {
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

  .metric-item {
    border-bottom: 1px solid var(--border-color);
  }

  .metric-item:nth-child(2),
  .metric-item:nth-child(4) {
    border-right: none;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .about-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    gap: 20px;
  }

  .nav-links {
    display: none;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric-item {
    border-right: none;
    padding: 20px 0;
  }

  .metric-item:last-child {
    border-bottom: none;
  }

  .skills-lists-col {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   LIVE STATUS BAR
   ========================================================================= */
.system-status-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 24px;
  background-color: rgba(8, 8, 10, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  z-index: 1000;
}

.status-group {
  display: flex;
  gap: 6px;
}

.status-label {
  color: var(--text-muted);
}

.status-value {
  color: var(--text-primary);
}

.status-online {
  color: #4ade80;
  text-shadow: 0 0 5px rgba(74, 222, 128, 0.3);
}

@media (max-width: 900px) {
  .system-status-bar {
    bottom: 12px;
    right: 12px;
    left: 12px;
    justify-content: center;
    font-size: 0.6rem;
  }
}

/* =========================================================================
   ESTILOS PARA WRITE-UPS
   ========================================================================= */
.writeup-post {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  transition: var(--transition);
  margin-bottom: 24px;
}

.writeup-post:hover {
  border-color: var(--accent-blue-dim);
}

.writeup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.writeup-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.writeup-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.writeup-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  background-color: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 700;
}

.writeup-tag.htb {
  background-color: rgba(159, 239, 0, 0.1);
  color: #9fef00;
  border: 1px solid rgba(159, 239, 0, 0.2);
}

.writeup-tag.thm {
  background-color: rgba(255, 60, 60, 0.1);
  color: #ff3c3c;
  border: 1px solid rgba(255, 60, 60, 0.2);
}

.writeup-tag.personal {
  background-color: rgba(92, 138, 255, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(92, 138, 255, 0.2);
}

.writeup-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Markdown Content Styling */
.markdown-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  word-break: break-word;
  overflow-wrap: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 1.5em 0 0.75em;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.markdown-body h1 {
  font-size: 1.6rem;
}

.markdown-body h2 {
  font-size: 1.3rem;
}

.markdown-body h3 {
  font-size: 1.1rem;
}

.markdown-body p {
  margin-bottom: 1.2em;
}

.markdown-body pre {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid var(--border-color);
  max-width: 100%;
  box-sizing: border-box;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.8rem;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-blue);
}

/* =========================================================================
   ACTIVITY GRAPH (GITHUB STYLE)
   ========================================================================= */
.activity-graph-wrapper {
  max-width: 860px;
  margin: 0 auto 40px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  width: 100%;
  box-sizing: border-box;
}

.activity-graph-wrapper::-webkit-scrollbar {
  display: none;
}

.activity-graph-grid {
  display: grid;
  padding-right: 24px;
  /* 52 weeks + 1 day = 53 columns usually, but grid-auto-flow: column handles it */
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  gap: 4px;
  width: max-content;
}

.activity-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 0.05);
  /* Empty / Level 0 */
  transition: var(--transition);
}

.activity-cell:hover {
  outline: 1px solid rgba(255, 255, 255, 0.5);
  outline-offset: 1px;
}

/* GitHub Classic Green Palette Override (adapted for dark mode base) */
.activity-cell.level-1 {
  background-color: #0e4429;
}

.activity-cell.level-2 {
  background-color: #006d32;
}

.activity-cell.level-3 {
  background-color: #26a641;
}

.activity-cell.level-4 {
  background-color: #39d353;
}

/* =========================================================================
   LANGUAGE SWITCHER (PILL)
   ========================================================================= */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px;
  margin-right: 24px;
  position: relative;
  overflow: hidden;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 16px;
  transition: color 0.3s ease;
  z-index: 1;
  position: relative;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  color: #0a0a0a;
  /* Dark text for contrast against bright accent */
}

/* Background animated pill */
.lang-switcher::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background-color: var(--accent-blue);
  border-radius: 16px;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 0;
}

/* If the second button is active, slide the pill to the right */
.lang-switcher:has(.lang-btn[data-lang="es"].active)::before {
  transform: translateX(100%);
}

.lang-divider {
  display: none;
  /* Hide the | divider on the UI */
}

/* Ensure nav-actions is flex */
.nav-actions {
  display: flex;
  align-items: center;
}

/* =========================================================================
   WRITE-UPS LAYOUT & SIDEBAR
   ========================================================================= */
.writeups-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: 100px;
  width: 100%;
}

.writeups-feed {
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.writeup-post {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.writeups-sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-search input {
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.sidebar-search input:focus {
  border-color: var(--accent-blue);
}

.sidebar-block h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.tag-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--text-primary);
}

.tag-btn.active {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #000;
  font-weight: 600;
}

@media (max-width: 768px) {
  .writeups-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .writeups-sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  .writeups-sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-block {
    min-width: 180px;
  }
}
