@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap');

:root {
  --header-h: 74px;
  --primary: #FFC107;
  --bg: #0e1621;
  --text-dim: #d0d6dc;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Ubuntu", sans-serif; }

html, body {
  height: 100%;
}

html {
  background: var(--bg);
}

body { 
  background: var(--bg); 
  color: white; 
  overflow-x: hidden; 
  position: relative;
  z-index: 0;              /* importante para que el pseudo-elemento se apile bien */
  isolation: isolate;      /* evita bugs raros con z-index negativo */
}

/* --- FONDO DINÁMICO MEJORADO --- */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  /* Gradiente radial con el amarillo del tema a baja opacidad (visible pero sutil) */
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 193, 7, 0.05) 0%, transparent 60%),
    radial-gradient(circle at 100% 0%, rgba(255, 193, 7, 0.035) 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(120, 180, 255, 0.025) 0%, transparent 50%);

  background-size: 200% 200%;
  animation: backgroundMove 20s ease-in-out infinite alternate;

  z-index: -1;             /* antes era -2 (a veces no se ve) */
  pointer-events: none;
}

@keyframes backgroundMove {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 100%; }
}

/* Aseguramos que las secciones no tapen el fondo si tienen color sólido */
section {
  position: relative;
  background: transparent !important;
}

/* HEADER */
header {
  position: fixed; top: 0; width: 100%; height: var(--header-h);
  background: #0b121a; display: flex; align-items: center;
  justify-content: space-between; padding: 0 60px; z-index: 100;
}

.nav-brand { display: flex; align-items: center; gap: 15px; }
.brand-logo { 
  width: 44px; height: 44px; 
  background: url('assets/logo/logo_amarillo.png') no-repeat center/contain;
}
.brand-name { font-weight: 700; font-size: 20px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: white; text-decoration: none; font-weight: 700; font-size: 16px; }
.nav-contact { border: 1px solid var(--primary); color: var(--primary) !important; padding: 6px 14px; border-radius: 6px; }

/* HERO SECTION */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 20px) 60px 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

/* Fondo animado sutil */
.hero-bg-glow {
  position: absolute;
  top: -20%; right: -10%;
  width: 60%; height: 100%;
  background: radial-gradient(circle, rgba(255, 193, 7, 0.04) 0%, rgba(14, 22, 33, 0) 70%);
  z-index: -1;
  animation: glow-move 10s ease-in-out infinite alternate;
}

@keyframes glow-move {
  from { transform: translate(0, 0); }
  to { transform: translate(-50px, 50px); }
}

.hero-text { flex: 1; max-width: 600px; z-index: 2; }
.hero-text h1 { font-size: 4.5rem; line-height: 1.1; margin-bottom: 10px; }
.hero span {
  display: inline-block;
  background: linear-gradient(90deg, #FFC107 0%, #fce7aa 45%, #FFC107 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine-effect 8s ease-in-out infinite;
}
.hero-text h2 { font-size: 2rem; color: var(--text-dim); margin-bottom: 30px; }

/* Botones y Robot debajo */
.buttons { 
  margin-bottom: 40px; 
  display: flex;       /* Usar flex para control total */
  flex-wrap: wrap;     /* Permitir que bajen de línea si no caben */
  gap: 15px;           /* Espacio uniforme entre ellos */
}

.cta { 
  padding: 12px 24px; 
  border: 1px solid var(--primary); 
  color: var(--primary); 
  text-decoration: none; 
  font-weight: 700; 
  border-radius: 8px; 
  margin-right: 0;     /* Quitamos el margin-right viejo para usar gap */
  transition: 0.3s;
  display: inline-block;
  white-space: nowrap; /* Evita que el texto del botón se rompa */
}
.cta:hover { background: rgba(255, 193, 7, 0.1); }

.hero-robot-container { width: 180px; }
#hero-robot { width: 100%; cursor: pointer; animation: robot-wave 1.5s ease-in-out 3; }

/* Visual Derecha: Logo Naranja */
.hero-visual { flex: 1; display: flex; justify-content: flex-end; align-items: center; }
.hero-main-logo {
  width: 450px; height: 450px;
  background: url('assets/logo/logo_amarillo.png') no-repeat center/contain;
  opacity: 0.9;
  filter: drop-shadow(0 0 20px rgba(255, 193, 7, 0.2));
  animation: float-logo 6s ease-in-out infinite;
}

@keyframes float-logo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.scroll-invite {
  position: absolute;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; color: var(--text-dim); font-size: 13px; font-weight: 500;
  letter-spacing: 1px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 5;
}

.scroll-invite.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mouse {
  width: 22px; height: 36px;
  border: 2px solid var(--text-dim); border-radius: 20px;
  display: flex; justify-content: center; padding-top: 6px;
}
.wheel {
  width: 3px; height: 7px; background: var(--primary);
  border-radius: 2px; animation: scroll-anim 2s infinite;
}

@keyframes scroll-anim {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(15px); opacity: 0; }
}

/* ABOUT SECTION */
#about { padding: 120px 60px; }
.about-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 80px; }
.about-text-column h2 { font-size: 2.5rem; color: var(--primary); margin-bottom: 30px; }

/* MEJORA: Texto justificado en el lead */
.lead { 
  font-size: 1.2rem; 
  border-left: 3px solid var(--primary); 
  padding-left: 20px; 
  margin-bottom: 30px;
  text-align: justify;
  text-justify: inter-word;
}

.hl { color: var(--primary); font-weight: 700; }
.text-block { margin-bottom: 35px; }
.text-block h3 { color: var(--primary); margin-bottom: 10px; }

/* MEJORA: Texto justificado en párrafos de About */
.text-block p { 
  color: var(--text-dim); 
  line-height: 1.7; 
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.btn-cv { 
  display: inline-block; padding: 12px 30px; border: 1px solid var(--primary); 
  color: var(--primary); text-decoration: none; font-weight: 700; border-radius: 8px;
}

/* VISUAL ABOUT */
.about-visual-column { display: flex; flex-direction: column; align-items: center; gap: 40px; }
.floating-wrench-robot { width: 300px; animation: float-wrench 4s ease-in-out infinite alternate; }
.tickers-container { width: 100%; max-width: 400px; }
.ticker-wrap { background: rgba(255,255,255,0.03); padding: 15px 0; border-radius: 10px; overflow: hidden; }
.ticker-move { display: flex; width: max-content; animation: ticker-loop 20s linear infinite; }
.ticker-item { padding: 0 20px; font-size: 2rem; color: #d0d6dc; }
.robotics-panel { width: 100%; max-width: 400px; }
.panel-title { color: var(--primary); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 2px; margin-bottom: 20px; text-align: center; }
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tool-box { background: white; border-radius: 8px; height: 90px; display: flex; align-items: center; justify-content: center; padding: 10px; animation: gentle-float 3s ease-in-out infinite alternate; animation-delay: var(--delay); }
.tool-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pddl-text { font-family: monospace; font-weight: 900; color: #1a1a1a; border: 2px solid #1a1a1a; padding: 2px 4px; }

/* --- SECCIÓN PROYECTOS --- */
#projects { padding: 80px 60px; }

/* Filtros */
.filter-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 40px 0;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  padding: 8px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
}

.filter-btn.active {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.3);
}

/* Grid y Card */
.projects-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); 
  gap: 30px; 
  padding-top: 40px; 
}

.project-card { 
  background: rgba(255, 255, 255, 0.03); 
  border: 1px solid rgba(255, 255, 255, 0.1); 
  border-radius: 16px; 
  overflow: hidden; 
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.project-card:hover { 
  border-color: var(--primary); 
  transform: translateY(-5px); 
}

/* Área de Media (Imagen/Video) */
.project-media { 
  position: relative;
  height: 200px; 
  background: #162130; 
  overflow: hidden;
}

.project-media img, .project-media video { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  position: absolute;
  top: 0; left: 0;
  transition: opacity 0.5s ease;
}

.preview-media { opacity: 0; }
.project-card.has-preview:hover .static-img { opacity: 0; }
.project-card:hover .preview-media { opacity: 1; }

.play-overlay-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 193, 7, 0.9);
  color: #000;
  border: none;
  width: 50px; height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 15;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.project-card:hover .play-overlay-btn { opacity: 1; }

.project-media.player-active {
  height: 450px;
  background: #000;
}

.close-player {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
} 

.project-media.player-active .close-player { display: flex; }

/* Cuerpo de la Card */
.project-body { padding: 20px; flex-grow: 1; }
.project-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cat-tag { 
  font-size: 10px; padding: 4px 10px; background: rgba(255,193,7,0.1); 
  border-radius: 4px; color: var(--primary); font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}

.project-body h3 { margin-bottom: 8px; font-size: 1.3rem; }
.short-desc { color: var(--text-dim); font-size: 0.95rem; line-height: 1.5; }

/* Despliegue de Detalles */
.details-toggle {
  background: none; border: none; color: white; cursor: pointer;
  display: flex; align-items: center; gap: 8px; font-weight: 700;
  padding: 15px 0 5px; font-size: 14px; width: 100%;
}

.arrow { transition: transform 0.3s ease; display: inline-block; }

.details-content {
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s ease-out;
  opacity: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* MEJORA: Texto justificado en la descripción expandida */
.details-content p {
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.6;
  margin-top: 10px;
  hyphens: auto;
}

.project-card.expanded .details-content {
  max-height: 600px;
  opacity: 1;
  padding-bottom: 15px;
}

/* Botón GitHub */
.github-btn {
  display: inline-block; margin-top: 15px; padding: 10px 20px;
  background: var(--primary); color: #000; text-decoration: none;
  border-radius: 6px; font-weight: 700; font-size: 13px;
}

.education-block {
  margin-bottom: 30px !important;
  max-width: 450px; /* Mantiene la tarjeta compacta */
}

.edu-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  border-radius: 10px;
  transition: 0.3s;
}

.edu-card:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

.edu-logo-wrapper {
  background: white; /* El cuadro blanco original */
  min-width: 50px;
  max-width: 50px;
  height: 50px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}

.edu-logo-wrapper img {
  width: 90%;
  height: auto;
  object-fit: contain;
}

.edu-info h4 {
  color: white;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.2;
  text-align: left; /* Forzamos alineación a la izquierda */
}

.edu-info p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 2px 0;
  text-align: left; /* Forzamos alineación a la izquierda */
}

.edu-status {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* CONTACT & FOOTER */
#contact { padding: 100px 60px; text-align: center; }
.contact-icons { display: flex; justify-content: center; gap: 30px; margin-top: 30px; }
.contact-icons a { width: 50px; height: 50px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.contact-icons a:hover { border-color: var(--primary); transform: translateY(-3px); }
.contact-icons i { width: 22px; height: 22px; filter: invert(1); background-size: contain; background-repeat: no-repeat; }
.icon-linkedin { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z'/%3E%3C/svg%3E"); }
.icon-github { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.041-1.61-4.041-1.61-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z'/%3E%3C/svg%3E"); }
.icon-mail { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12.713l-11.985-9.713h23.97l-11.985 9.713zm0 2.574l12-9.725v15.438h-24v-15.438l12 9.725z'/%3E%3C/svg%3E"); }

.footer { padding: 40px 60px; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; color: var(--text-dim); }

/* ANIMACIONES */
@keyframes ticker-loop { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes shine-effect { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }
@keyframes robot-wave { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(15deg); } 75% { transform: rotate(-15deg); } }
@keyframes float-wrench { from { transform: translateY(0) rotate(0); } to { transform: translateY(-20px) rotate(5deg); } }
@keyframes gentle-float { from { transform: translateY(0); } to { transform: translateY(-10px); } }

/* RESPONSIVE */
@media (max-width: 1000px) {
  .buttons {justify-content: center;}
  .hero { flex-direction: column; text-align: center; height: auto; padding-bottom: 100px; }
  .hero-visual { display: none; }
  .hero-text { max-width: 100%; }
  .hero-text h1 { font-size: 3.2rem; }
  .about-layout { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* MEJORA: En móvil el texto se lee mejor a la izquierda */
  .text-block p, .details-content p, .lead { text-align: left; }
}

@media (max-width: 700px) {
  .projects-grid { grid-template-columns: 1fr; }
  header { padding: 0 20px; }
}

/* =========================
   NAV BRAND AS LINK
   ========================= */
.nav-brand{
  display:flex;
  align-items:center;
  gap:15px;
  color:white;
  text-decoration:none;
}
.nav-brand:visited{ color:white; }
.nav-brand:hover{ opacity:0.95; }

/* =========================
   ABOUT overflow fix (prevents horizontal scroll on mobile)
   ========================= */
.about-layout,
.about-text-column,
.about-visual-column{
  min-width: 0;
}

.about-text-column p,
.about-text-column h2,
.about-text-column h3,
.about-text-column h4,
.lead{
  overflow-wrap: anywhere;
  word-break: break-word;
}

#about img{
  max-width: 100%;
  height: auto;
}

/* =========================
   BLOG SECTION (cards + modal reader)
   ========================= */
#blogs{
  padding: 80px 60px;
}

.section-subtitle{
  color: var(--text-dim);
  margin-top: 8px;
  margin-bottom: 28px;
  max-width: 760px;
}

.blogs-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 28px;
}

.blog-card{
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.35s ease;
  display:flex;
  flex-direction: column;
}

.blog-card:hover{
  border-color: var(--primary);
  transform: translateY(-4px);
}

.blog-cover{
  height: 210px;
  background: #162130;
  position: relative;
  overflow: hidden;
}

.blog-cover img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.blog-body{
  padding: 18px 20px 20px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.blog-meta{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

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

.blog-tag{
  font-size: 10px;
  padding: 4px 10px;
  background: rgba(255,193,7,0.1);
  border-radius: 4px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.blog-title{
  font-size: 1.35rem;
  line-height: 1.25;
}

.blog-excerpt{
  color: var(--text-dim);
  line-height: 1.55;
}

.blog-read{
  margin-top: auto;
  align-self: flex-start;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,193,7,0.65);
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  transition: 0.25s;
}
.blog-read:hover{
  background: rgba(255,193,7,0.1);
}

/* Modal */
.blog-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 200;
}

.blog-modal.is-open{ display:block; }

.blog-modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.blog-modal-card{
  position: relative;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(11,18,26,0.98);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.blog-modal-close{
  position:absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: white;
  cursor:pointer;
  font-size: 18px;
}

.blog-modal-body{
  padding: 28px 28px 34px;
  overflow: auto;
  max-height: calc(100vh - 32px);
}

.blog-modal-body h2{
  margin-bottom: 6px;
}

.blog-post-top{
  display:flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.blog-post-cover{
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: #162130;
  margin: 18px 0 18px;
}

.blog-post-cover img{
  width: 100%;
  height: min(420px, 42vh);
  object-fit: cover;
  display:block;
}

.blog-content{
  color: var(--text-dim);
  line-height: 1.75;
  font-size: 1rem;
}

.blog-content p{
  margin: 12px 0;
  overflow-wrap: anywhere;
}

.blog-content h3{
  color: var(--primary);
  margin-top: 22px;
  margin-bottom: 8px;
}

.blog-content ul{
  margin: 10px 0 14px 18px;
}

.blog-content code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.blog-codeblock{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 14px;
  overflow:auto;
  margin: 12px 0 16px;
}

.blog-figure{
  margin: 18px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: #162130;
}

.blog-figure img{
  width: 100%;
  height: auto;
  display:block;
}

.blog-caption{
  padding: 10px 12px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.blog-links{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.blog-link{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,193,7,0.45);
  color: var(--primary);
  text-decoration:none;
  font-weight: 700;
}
.blog-link:hover{
  background: rgba(255,193,7,0.1);
}

/* Responsive for blog */
@media (max-width: 1000px){
  #blogs{ padding: 80px 60px; }
}

@media (max-width: 700px){
  #blogs{ padding: 80px 20px; }
  .blogs-grid{ grid-template-columns: 1fr; }
  .blog-cover{ height: 190px; }
  .blog-modal-body{ padding: 22px 18px 26px; }
}

/* BLOOOOOOG */
/* =========================
   BLOG Typography & Blocks
   ========================= */

.blog-title{
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  line-height: 1.15;
  margin: 10px 0 12px;
  letter-spacing: -0.5px;
}

.blog-meta{
  display:flex;
  align-items:center;
  gap:10px;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.blog-dot{ opacity: 0.55; }

.blog-excerpt{
  color: rgba(255,255,255,0.78);
  line-height: 1.65;
  margin: 0 0 14px;
  max-width: 70ch;
}

.blog-tags{ display:flex; flex-wrap:wrap; gap:8px; margin: 10px 0 0; }
.blog-tag{
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.78);
}

.blog-content{
  margin-top: 18px;
  line-height: 1.75;
  font-size: 15px;
  color: rgba(255,255,255,0.82);
}

.blog-content a{
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,193,7,0.25);
}
.blog-content a:hover{
  border-bottom-color: rgba(255,193,7,0.6);
}

.inline-code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.blog-h3, .blog-h4{
  color: white;
  margin: 20px 0 10px;
  letter-spacing: -0.2px;
}
.blog-h3{ font-size: 1.2rem; }
.blog-h4{ font-size: 1.05rem; color: rgba(255,255,255,0.92); }

.blog-p{ margin: 10px 0; }

.blog-ul{
  margin: 10px 0 14px 18px;
  padding: 0;
}
.blog-ul li{ margin: 8px 0; }

.blog-quote{
  margin: 16px 0;
  padding: 14px 16px;
  border-left: 3px solid rgba(255,193,7,0.8);
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  color: rgba(255,255,255,0.78);
}

.blog-callout{
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.blog-callout-title{
  font-weight: 800;
  margin-bottom: 6px;
  color: rgba(255,255,255,0.92);
}
.blog-callout.is-info{ border-color: rgba(255,193,7,0.22); }
.blog-callout.is-warning{ border-color: rgba(255,120,120,0.22); }
.blog-callout.is-success{ border-color: rgba(120,255,180,0.18); }
.blog-callout.is-note{ border-color: rgba(160,160,255,0.18); }

.blog-divider{
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 18px 0;
}

.blog-figure{ margin: 16px 0; }
.blog-img{
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.blog-caption{
  margin-top: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
}

.blog-code{
  margin: 14px 0;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: auto;
}
.blog-code code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
}

.blog-links{
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.blog-link{
  display:flex;
  justify-content: space-between;
  align-items:center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.blog-link:hover{
  border-color: rgba(255,193,7,0.25);
  background: rgba(255,255,255,0.055);
}
.blog-link-label{ color: rgba(255,255,255,0.9); font-weight: 700; }
.blog-link-arrow{ color: rgba(255,193,7,0.9); font-weight: 900; }

.blog-video video{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #000;
}

/* =========================
   BLOG Layout (like Projects)
   ========================= */

/* Align Blog section like Projects (same side padding) */
#blog{
  padding-left: 60px;
  padding-right: 60px;
}

/* Mobile padding consistent */
@media (max-width: 820px){
  #blog{
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* Grid similar to projects */
.blog-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 22px;
  align-items: start;
}

/* Card layout: image TOP (project-style), not side */
.blog-card{
  display: block;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  width: 100%;
  max-width: 520px; /* similar to project cards */
}

/* Cover with consistent ratio */
.blog-card-cover{
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #162130;
}

/* Image never deforms */
.blog-card-cover img{
  width:100%;
  height:100%;
  object-fit: cover;       /* crop, no stretch */
  object-position: center; /* keep subject centered */
  display:block;
}

/* Body spacing */
.blog-card-body{
  padding: 16px 18px 18px;
  min-width: 0;
}

.blog-card-title{
  margin: 10px 0 8px;
  font-size: 1.1rem;
  line-height: 1.25;
}

.blog-card-excerpt{
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
}

.blog-read-btn{
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,193,7,0.35);
  background: rgba(255,193,7,0.12);
  color: var(--primary);
  cursor:pointer;
  font-weight: 800;
}

/* Empty state card */
.blog-empty-card{
  margin-top: 18px;
  max-width: 520px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

/* =========================
   BLOG Modal
   ========================= */

.blog-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 999;
}
.blog-modal-overlay.open{ display:flex; }

.blog-modal{
  width: min(980px, 96vw);
  max-height: 88vh;
  overflow:auto;
  border-radius: 18px;
  background: #0b121a;
  border: 1px solid rgba(255,255,255,0.10);
  position: relative;
}

.blog-modal-close{
  position: sticky;
  top: 10px;
  float: right;
  margin: 10px 10px 0 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: white;
  cursor:pointer;
}

.blog-modal-content{
  padding: 18px 18px 24px;
}

body.modal-open{ overflow:hidden; }

/* =========================
   Section Headings (Global)
   ========================= */

section > h2 {
  font-size: clamp(2.4rem, 3vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 22px;
  color: white;
}


/* =========================
   Header micro-interactions
   ========================= */
.nav-brand{
  cursor: pointer;
}

.nav-brand:hover .brand-logo{
  filter: drop-shadow(0 0 14px rgba(255,193,7,0.35));
  transform: translateY(-1px) scale(1.03);
  transition: 0.25s ease;
}

.nav-links a{
  position: relative;
}

.nav-links a::after{
  content:"";
  position:absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: rgba(255,193,7,0.85);
  transition: width 0.25s ease;
}

.nav-links a:hover::after{
  width: 100%;
}


/* =========================
   Section headings consistency
   ========================= */
section > h2{
  color: var(--primary);
}

/* Ensure About heading matches the global rule */
.about-text-column h2{
  color: var(--primary);
  font-size: clamp(2.4rem, 3vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 22px;
}


/* =========================
   About: Pause-on-hover + highlight
   ========================= */
.ticker-wrap:hover .ticker-move{
  animation-play-state: paused;
}

.ticker-item{
  transition: transform 0.2s ease, color 0.2s ease, filter 0.2s ease;
  cursor: default;
}

.ticker-item:hover{
  color: var(--primary);
  filter: drop-shadow(0 0 10px rgba(255,193,7,0.35));
  transform: translateY(-2px) scale(1.08);
}

.tools-grid:hover .tool-box{
  animation-play-state: paused;
}

.tool-box{
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tool-box:hover{
  border-color: rgba(255,193,7,0.85);
  box-shadow: 0 0 18px rgba(255,193,7,0.18);
  transform: translateY(-6px);
  animation-play-state: paused;
}


/* =========================
   Mobile navigation toggle
   ========================= */
.nav-toggle{
  display:none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle span{
  display:block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  margin: 4px 0;
}

@media (max-width: 820px){
  .nav-toggle{ display:block; }
  .nav-links{
    position: absolute;
    top: var(--header-h);
    right: 0;
    left: 0;
    background: rgba(11,18,26,0.98);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 14px 20px 18px;
    display: none;
    flex-direction: column;
    gap: 14px;
  }
  .nav-links.open{ display:flex; }
}
