:root {
  /* Sidebar colors */
  --sidebar-bg: rgba(205, 205, 205, 0.95);
  --sidebar-wine: #8B2332;
  --sidebar-text: #8B2332;
  --sidebar-soft: #b67a8f;

  /* Main area (projects) colors */
  --main-bg: #fff;
  --main-title: #222;

  /* Card colors */
  --card-bg: #f3f3f3;
  --card-border: #515151;
  --card-accent: #222;
  --card-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);

  /* General text colors */
  --text-main: #222;
  --text-soft: #444;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--main-bg);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  background: var(--sidebar-bg);
  box-shadow: 3px 0 24px rgba(0, 0, 0, 0.09);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  padding-top: 36px;
  border-right: 1px solid #272727;
}

.profile {
  width: 90%;
  text-align: center;
}

.avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 18px #222;
  margin-bottom: 12px;
  border: 6px solid var(--sidebar-wine);
  background: #232323;
}

.sidebar h1 {
  margin: 0 0 6px 0;
  font-size: 2em;
  color: var(--sidebar-wine);
  letter-spacing: 2px;
}

.sidebar p,
.sidebar nav,
.sidebar a,
.sidebar hr,
.sidebar strong {
  color: var(--sidebar-text);
  font-size: 1.08em;
}

.sidebar nav {
  margin-top: 18px;
}

.sidebar nav a {
  display: inline-block;
  margin: 0 10px;
  color: var(--sidebar-wine);
  text-decoration: none;
  font-weight: 500;
  font-size: 1em;
  padding: 8px 16px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.sidebar nav a:hover {
  color: #fff;
  background: var(--sidebar-wine);
  text-decoration: underline;
}

.sidebar hr {
  border: none;
  border-top: 1.5px solid var(--sidebar-wine);
  margin: 16px 0;
}

/* --- MAIN --- */
main {
  margin-left: 320px;
  width: calc(100vw - 320px);
  min-height: 100vh;
  background: var(--main-bg);
  padding: 0;
}

section {
  max-width: 950px;
  margin: 48px auto;
  padding: 0 18px;
}

/* --- TITULOS --- */
h2 {
  font-size: 2em;
  color: var(--main-title);
  margin-bottom: 24px;
}

/* --- PORTAFOLIO --- */
.portfolio {
  display: flex;
  flex-direction: column;
  gap: 38px;
  justify-content: flex-start;
}

/* CORRECCIÓN: más ancho para laptops/desktops */
.work-card {
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  padding: 28px;
  width: 100%;
  max-width: 780px;
  /* <-- Antes era 520px */
  margin: 0 auto 24px auto;
  border: 1.5px solid var(--card-border);
  transition: transform 0.5s, opacity 0.5s, box-shadow 0.3s;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(70px);
}

@media (max-width: 1200px) {
  .work-card {
    max-width: 98vw;
    padding: 24px;
  }
}

@media (max-width: 900px) {
  .work-card {
    width: 98vw;
    max-width: 98vw;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 18px;
    padding: 16px;
    box-sizing: border-box;
  }
}

@media (max-width: 600px) {
  .work-card {
    width: 99vw;
    max-width: 99vw;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 14px;
    padding: 10px;
    box-sizing: border-box;
  }
}

.work-card video,
img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 18px #ddd;
  border: 2px solid #222;
  background: #fff;
}

.work-card h3 {
  margin: 8px 0 10px 0;
  color: var(--card-accent);
  font-size: 1.25em;
}

.work-card p {
  color: var(--text-soft);
  font-size: 1em;
}

.work-card:hover {
  box-shadow: 0 8px 36px #22222233;
  transform: translateY(-4px) scale(1.025);
}

/* --- FOOTER --- */
footer {
  background: #222;
  color: #fff;
  text-align: center;
  padding: 24px 0 18px 0;
  margin-top: 36px;
  font-size: 1.1em;
  letter-spacing: 1px;
}

/* --- ANIMACIONES --- */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

.slide-up {
  opacity: 0;
  transform: translateY(70px);
  transition: opacity 1s, transform 1s;
}

.slide-up.appear {
  opacity: 1;
  transform: translateY(0);
}

/* --- VIDEO FONDO Y TEXTO ANIMADO --- */
.videobackground-letteranimated {
  position: relative;
  height: 60vh;
  min-height: 340px;
  overflow: hidden;
  background: #000;
}

.videobackground-letteranimated video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.6);
  object-position: top;
}

.videobackground-letteranimated .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #000 40%, transparent 100%);
  opacity: 0.5;
  pointer-events: none;
}

.videobackground-letteranimated .centered-text {
  position: absolute;
  left: 36px;
  bottom: 32px;
  z-index: 2;
  color: #fff;
  text-align: left;
  max-width: 80vw;
  animation: textFadeInMove 1.4s cubic-bezier(.61, .01, .12, 1) both;
}

.videobackground-letteranimated .centered-text h1 {
  font-size: 3em;
  font-weight: 800;
  margin: 0 0 10px 0;
  color: #8B2332;
  letter-spacing: 2px;
  text-shadow: 0 8px 18px #000, 0 2px 4px #fff2;
  animation: letterEffect 2.5s cubic-bezier(.61, .01, .12, 1) both;
}

.videobackground-letteranimated .centered-text p {
  font-size: 1.45em;
  color: #fff;
  margin: 0;
  font-weight: 500;
  text-shadow: 0 6px 14px #000, 0 1px 2px #8B233280;
  letter-spacing: 1px;
  animation: letterEffect2 1.6s 0.7s cubic-bezier(.61, .01, .12, 1) both;
}

@keyframes textFadeInMove {
  0% {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes letterEffect {
  0% {
    opacity: 0;
    letter-spacing: 24px;
    transform: translateY(30px) scale(0.9);
  }

  60% {
    opacity: 0.7;
    letter-spacing: 8px;
    transform: translateY(10px) scale(1.04);
  }

  100% {
    opacity: 1;
    letter-spacing: 2px;
    transform: translateY(0) scale(1);
  }
}

@keyframes letterEffect2 {
  0% {
    opacity: 0;
    letter-spacing: 12px;
    transform: translateY(20px) scale(0.96);
  }

  100% {
    opacity: 1;
    letter-spacing: 1px;
    transform: translateY(0) scale(1);
  }
}

/* --- VERSION MOVIL --- */
@media (max-width: 1200px) {
  .work-card {
    max-width: 98vw;
    padding: 24px;
  }
}

@media (max-width: 900px) {
  body {
    flex-direction: column;
    min-height: 100vh;
  }

  .sidebar {
    position: static;
    width: 100vw;
    height: auto;
    padding-top: 16px;
    box-shadow: none;
    border-right: none;
    border-bottom: 1px solid #272727;
    flex-direction: row;
    justify-content: space-around;
  }

  .profile {
    width: 100%;
    text-align: center;
    padding: 8px 0;
  }

  main {
    margin-left: 0;
    width: 100vw;
    min-height: auto;
  }

  .work-card {
    width: 98vw;
    max-width: 98vw;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 18px;
    padding: 16px;
    box-sizing: border-box;
  }

  section {
    margin: 24px auto;
    padding: 0 6vw;
    max-width: 98vw;
  }

  .videobackground-letteranimated .centered-text {
    left: 10px;
    bottom: 10px;
    max-width: 98vw;
  }

  .videobackground-letteranimated .centered-text h1 {
    font-size: 2em;
  }

  .videobackground-letteranimated .centered-text p {
    font-size: 1em;
  }

  .videobackground-letteranimated {
    height: 32vh;
    min-height: 140px;
  }
}

@media (max-width: 600px) {
  .avatar {
    width: 56px;
    height: 56px;
    border-width: 3px;
  }

  .sidebar h1 {
    font-size: 1.05em;
  }

  .sidebar {
    padding-top: 6px;
    flex-direction: column;
    align-items: center;
  }

  .work-card {
    padding: 10px;
  }

  section {
    padding: 0 2vw;
  }
}


.badge {
  display: inline-block;
  background: var(--sidebar-wine);
  color: #fff;
  padding: 4px 10px;
  margin-left: 4px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 500;
  margin-bottom: 8px;
}

.badge-supported {
  background: #2a9d8f;
}

.badge-norelease {
  background: #e76f51;
}

.badge-version-stable {
  background: #264653;
}

#services {
  padding-bottom: 32px;
}

#services h2 {
  font-size: 2em;
  color: #8B2332;
  margin-bottom: 32px;
  text-align: center;
  letter-spacing: 2px;
}

.services-cards {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}

.service-card {
  background: rgba(205, 205, 205, 0.95);
  border: #000 1.5px solid;
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(139, 35, 50, 0.10);
  padding: 32px 22px;
  width: 320px;
  max-width: 92vw;
  min-height: 220px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  transition: box-shadow 0.2s, transform 0.2s;

  animation: fadeInUp 0.8s forwards;
  animation-delay: 0.3s;
  will-change: transform, opacity;
  height: fit-content;
}

.service-card h3 {
  margin: 0 0 12px 0;
  font-size: 1.25em;
  color: #8B2332;
  font-weight: 700;
  white-space: nowrap;
  align-self: center;
}

.service-card p {
  color: #222;
  font-size: 1em;
  margin: 0;
}

.service-card:hover {
  box-shadow: 0 8px 32px #8B233222;
  transform: translateY(-4px) scale(1.025);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .services-cards {
    gap: 18px;
  }

  .service-card {
    width: 97vw;
    max-width: 97vw;
    padding: 22px 10px;
  }
}

@media (max-width: 600px) {
  #services h2 {
    font-size: 1.15em;
    margin-bottom: 18px;
  }

  .services-cards {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .service-card {
    width: 98vw;
    max-width: 98vw;
    padding: 14px 6px;
    min-height: 140px;
    font-size: 0.98em;
  }

  .service-card h3 {
    font-size: 1em;
  }
}

hr.divider {
  border: none;
  border-top: 1.5px solid var(--sidebar-wine);
  margin: 16px 0;
  width: 100%;
  max-width: 320px;
  transition: max-width 0.2s;
}

/* Responsive: en pantallas pequeñas ocupa casi todo el ancho */
@media (max-width: 600px) {
  hr.divider {
    max-width: 95vw;
    margin: 12px auto;
  }
}


/* Estilo para todos los span que contienen SVG íconos */
svg.icon-service {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-right: 12px;
  transition: box-shadow 0.2s, background 0.2s;
}


svg.icon-service:hover {
  box-shadow: 0 4px 16px #8B233244;
  background: #fff;
}

svg.icon-service:hover svg {
  fill: #b67a8f;
}

svg.icon-service {
  vertical-align: middle;

}

/* --- NAVEGACIÓN EN EL SIDEBAR --- EN FORMA DE LISTA */
.nav-links {
  margin-top: 12px;
  font-size: 0.95em;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  text-align: center;
  padding: 6px 0;
  width: 100%;
  color: #fff;
}

.nav-links .a {
  display: inline-block;
  margin: 0 6px;
  color: #fff;
  background-color: #3a000f;
  text-decoration: none;
  font-weight: 500;
  font-size: 1em;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.menu-title {
  display: block;
  border-top: var(--sidebar-wine) 1.5px solid;
  width: 100%;
  font-size: 1.85em;
  font-weight: 700;
  color: #8B2332;
  margin-top: 16px;
  letter-spacing: 2px;
}

