/* ==========================================================================
   Grade 2: Bootstrap + GSAP Portfolio Demo
   Custom styles extending Bootstrap 5
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
	--bs-body-bg: #ffffff;
	--bs-body-color: #111111;
	--bs-primary: #6366f1;
	--bs-primary-rgb: 99, 102, 241;

	/* Custom tokens */
	--color-bg-alt: #f8f9fa;
	--color-muted: #6c757d;
	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

body.dark-mode {
	--bs-body-bg: #000000;
	--bs-body-color: #ffffff;
	--color-bg-alt: #1a1a1a;
	--color-muted: #aaaaaa;
}

/* --------------------------------------------------------------------------
   2. Base Overrides
   -------------------------------------------------------------------------- */
body {
	background-color: var(--bs-body-bg);
	color: var(--bs-body-color);
	transition: background-color 0.3s ease, color 0.3s ease;
}

/* Use Manrope (Google Fonts) site-wide */
body, button, input, textarea, select {
	font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.bg-dark {
	background-color: var(--bs-body-bg) !important;
	transition: background-color 0.3s ease;
}

/* Section spacing */
.py-lg-6 {
	padding-top: 6rem !important;
	padding-bottom: 6rem !important;
}

/* --------------------------------------------------------------------------
   3. Navigation
   -------------------------------------------------------------------------- */
.navbar {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: background 0.3s;
}

body.dark-mode .navbar {
	background: rgba(0, 0, 0, 0.95);
}

/* Compact header styles */
.navbar {
	padding-top: 0.2rem;
	padding-bottom: 0.2rem;
}

.navbar .navbar-brand {
	font-size: 0.95rem; /* slightly smaller brand */
	font-weight: 600;
	letter-spacing: 0.02em;
}

.navbar.scrolled {
	background: rgba(255, 255, 255, 0.99);
}

body.dark-mode .navbar.scrolled {
	background: rgba(0, 0, 0, 0.99);
}

.nav-link {
	position: relative;
	padding: 0.5rem 1rem !important;
	color: var(--bs-body-color);
}

/* Make right-side nav items smaller, thin and lowercase */
.navbar-nav .nav-link {
	font-size: 0.85rem;
	font-weight: 300;
	text-transform: lowercase;
	opacity: 0.95;
	padding: 0.25rem 0.5rem !important;
}

.navbar-nav .nav-item + .nav-item {
	margin-left: 0.25rem;
}

.navbar .navbar-brand,
.navbar .nav-link {
	color: var(--bs-body-color) !important;
}

.nav-link:hover,
.navbar .navbar-brand:hover {
	color: var(--bs-primary) !important;
}

.nav-link::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 0;
	height: 3px; /* barra más visible */
	background: #000000; /* amarillo */
	border-radius: 2px;
	transition: width 0.3s, left 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
	width: 100%;
	left: 0;
}

/* --------------------------------------------------------------------------
   4. Hero Section
   -------------------------------------------------------------------------- */
.hero {
	background: var(--bs-body-bg);
}

.hero-bg {
	background: inherit;
	z-index: 0;
}

/* Floating shapes */
.floating-shapes {
	position: absolute;
	inset: 0;
	overflow: hidden;
	z-index: 0;
}

.shape {
	position: absolute;
	border-radius: 50%;
	filter: blur(60px);
	opacity: 0.4;
}

.shape-1 {
	width: 400px;
	height: 400px;
	background: var(--bs-primary);
	top: 10%;
	left: 10%;
}

.shape-2 {
	width: 300px;
	height: 300px;
	background: #ec4899;
	top: 60%;
	right: 10%;
}

.shape-3 {
	width: 250px;
	height: 250px;
	background: #14b8a6;
	bottom: 10%;
	left: 30%;
}

.hero-title {
	font-size: clamp(3.5rem, 12vw, 9rem);
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 0.95;
	
}


.hero-title2 {
	font-size: clamp(3.5rem, 12vw, 9rem);
	font-weight: 500;
	line-height: 0.95;
	margin-bottom: 1.5rem;

}

.hero-subtitle {
	opacity: 0.85;
	color: var(--color-muted);
}

/* Scroll indicator */
.scroll-indicator {
	z-index: 10;
}

.mouse {
	width: 26px;
	height: 42px;
	border: 2px solid rgba(17, 17, 17, 0.25);
	border-radius: 13px;
	position: relative;
}

.mouse::after {
	content: '';
	position: absolute;
	top: 8px;
	left: 50%;
	transform: translateX(-50%);
	width: 4px;
	height: 8px;
	background: rgba(17, 17, 17, 0.7);
	border-radius: 2px;
	animation: scrollMouse 1.5s ease-in-out infinite;
}

@keyframes scrollMouse {
	0%, 100% {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
	50% {
		opacity: 0.3;
		transform: translateX(-50%) translateY(12px);
	}
}

/* --------------------------------------------------------------------------
   5. About Section
   -------------------------------------------------------------------------- */
.about-image {
	position: relative;
}

.about-image::before {
	content: none; /* remove decorative border frame */
}

.about-image img {
	position: relative;
	z-index: 1;
	border-radius: 0; /* no rounded corners */
	max-width: 100%;
	width: clamp(250px, 50vw, 400px); /* smaller image */
}

/* About section dark theme */
#about {
	background-color: #000000 !important;
	color: #ffffff;
}

#about h2,
#about .lead,
#about p {
	color: #ffffff;
}

#about .text-muted {
	color: #d0d0d0 !important;
}

#about .fw-semibold {
	color: #ffffff;
}

/* Skills progress bars */
.progress {
	background-color: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	overflow: hidden;
}

.progress-bar {
	background: linear-gradient(90deg, var(--bs-primary), #818cf8);
	border-radius: 4px;
	width: 0; /* Animated by GSAP */
}

/* --------------------------------------------------------------------------
   6. Projects Section
   -------------------------------------------------------------------------- */
.project-card {
	background: var(--color-bg-alt);
	border-radius: 0;
	overflow: hidden;
	transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
	display: flex;
	flex-direction: column; /* mobile-first: stack */
	height: 100%;
}

.project-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .project-card:hover {
	box-shadow: 0 20px 40px rgba(255, 255, 255, 0.2);
}

.card-img-wrapper {
	aspect-ratio: 4/3;
	flex-shrink: 0;
	cursor: pointer;
}

.project-images {
	position: relative;
	width: 100%;
	height: 100%;
}

.project-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: filter 0.6s var(--ease-out), transform 0.6s var(--ease-out), opacity 0.3s ease;
	filter: grayscale(100%);
	opacity: 0;
	position: absolute;
	top: 0;
	left: 0;
}

.project-img.active {
	opacity: 1;
	position: relative;
}

.project-card:hover .project-img.active {
	transform: scale(1.08);
	filter: grayscale(0%);
}

/* Image Navigation */
.project-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 100%;
	display: flex;
	justify-content: space-between;
	padding: 0 10px;
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: 10;
}

.card-img-wrapper:hover .project-nav {
	opacity: 1;
}

.nav-btn {
	background: rgba(0, 0, 0, 0.5);
	color: white;
	border: none;
	padding: 10px 15px;
	font-size: 1.5rem;
	cursor: pointer;
	transition: background 0.3s;
	border-radius: 0;
}

body.dark-mode .nav-btn {
	background: rgba(255, 255, 255, 0.3);
}

.nav-btn:hover {
	background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .nav-btn:hover {
	background: rgba(255, 255, 255, 0.6);
}

/* Image Counter */
.image-counter {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background: rgba(0, 0, 0, 0.6);
	color: white;
	padding: 5px 10px;
	font-size: 0.85rem;
	border-radius: 0;
	z-index: 10;
}

.projects-header .display-5 {
	font-size: 2rem;
	margin-bottom: 0;
}

.projects-header .lead {
	font-size: 1rem;
	margin-bottom: 0;
}

.card-body {
	padding: 1.5rem;
}

.card-title {
	margin-bottom: 0.75rem;
}

/* Badge styling */
.bg-primary-subtle {
	background-color: rgba(99, 102, 241, 0.15) !important;
}

.text-primary {
	color: var(--bs-primary) !important;
}

.text-muted {
	color: var(--color-muted) !important;
}

/* Projects: stacked on mobile, side-by-side on wider screens */
@media (min-width: 768px) {
	.project-card {
		flex-direction: row;
		gap: 1.5rem;
		align-items: stretch;
	}

	.project-card .card-img-wrapper {
		flex: 0 0 60%;
		aspect-ratio: 16/10;
		height: auto;
	}

	.project-card .card-body {
		flex: 1 1 40%;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}
}

/* Thumbnails inside project cards */
.project-thumbs {
	align-items: center;
}
.project-thumbs img.project-thumb {
	width: 72px;
	height: 72px;
	object-fit: cover;
	cursor: pointer;
	opacity: 0.9;
	border: 2px solid transparent;
}
.project-thumbs img.project-thumb:hover {
	opacity: 1;
}
.project-thumbs img.project-thumb.active {
	border-color: var(--bs-primary);
	opacity: 1;
}

/* Make badges neutral inside project cards (remove colored category style) */
.project-card .badge {
	background-color: rgba(0,0,0,0.05);
	color: var(--color-muted);
	border-radius: 4px;
	padding: 0.25rem 0.5rem;
	font-size: 0.8rem;
}

/* Contact section: smaller, cleaner */
#contact h2 {
	font-size: 2rem;
}
#contact p.lead {
	font-size: 0.95rem;
	color: var(--color-muted);
}

/* Custom contact button */
.btn-contact {
	background: #000000;
	color: #ffffff !important;
	padding: 0.5rem 1rem;
	font-weight: 600;
	font-size: 0.95rem;
	border-radius: 4px;
	display: inline-block;
}
.btn-contact:hover {
	background: #111111;
	color: #ffffff;
	transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   7. Contact Section
   -------------------------------------------------------------------------- */
.social-links a {
	transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
	color: var(--bs-primary) !important;
	transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */
.btn-primary {
	background: var(--bs-primary);
	border-color: var(--bs-primary);
	padding: 0.75rem 2rem;
	font-weight: 600;
	transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
	background: #818cf8;
	border-color: #818cf8;
	transform: translateY(-2px);
	box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-outline-light {
	padding: 0.75rem 2rem;
	font-weight: 600;
}

.btn-outline-light:hover {
	transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   9. Utilities
   -------------------------------------------------------------------------- */
.z-1 {
	z-index: 1;
}

/* --------------------------------------------------------------------------
   10. Accessibility: Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.shape {
		display: none;
	}

	.project-card:hover {
		transform: none;
	}

	.project-card:hover .card-img-wrapper img {
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   11. Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
	.hero-title {
		font-size: 3rem;
	}

	.shape {
		transform: scale(0.6);
	}
}

@media (max-width: 575.98px) {
	.hero-title {
		font-size: 2.5rem;
	}

	.hero-cta .btn {
		display: block;
		width: 100%;
		margin-bottom: 1rem;
	}

	.hero-cta .btn:last-child {
		margin-bottom: 0;
	}

	.about-image::before {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   INTRO ANIMATION
   -------------------------------------------------------------------------- */

.intro {
	position: fixed;
	inset: 0;
	background-color: #ffffff; /* blanco: fondo inicial deseado */
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.intro-title {
	font-size: clamp(4rem, 12vw, 10rem);
	font-weight: 800;
	letter-spacing: 0.08em;
	color: #111111; /* texto oscuro sobre fondo blanco */
	font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-transform: none;
}

/* --------------------------------------------------------------------------
   PRE-INTRO ANIMATION
   -------------------------------------------------------------------------- */

.pre-intro {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    z-index: 9998;
    pointer-events: none;
}

.pre-word {
	color: #c8c8c8; /* gris para la pre-intro */
	font-weight: 700;
	font-size: clamp(2rem, 8vw, 6rem);
	opacity: 0;
	letter-spacing: 0.18em;
	font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	text-transform: lowercase;
	line-height: 0.9;
}

@media (max-width: 575.98px) {
    .pre-word {
        font-size: clamp(1.6rem, 10vw, 3.2rem);
        letter-spacing: 0.12em;
    }
}

/* --------------------------------------------------------------------------
   Projects scroller (hero) - horizontal auto-scroll of square thumbnails
   -------------------------------------------------------------------------- */
.projects-scroller {
	position: absolute; /* overlay above hero content */
	left: 50%;
	top: 8%; /* move a bit higher so the bar sits more prominently above the title */
	transform: translateX(-50%);
	width: 500%;
	max-width: 2500px; /* allow the bar to occupy more horizontal space */
	overflow: visible; /* allow hovered image to expand downward */
	padding-bottom: 0.75rem; /* extra space for expanded image */
	z-index: 12;
}

.scroller-track {
	display: flex;
	gap: 1.25rem; /* slightly larger gap for bigger thumbnails */
	align-items: flex-start; /* align thumbnails to top */
	flex-wrap: nowrap; /* ensure one single row for seamless looping */
	/* Duplicate content approach: JS (GSAP) handles continuous scrolling for seamless loop */
	/* animation removed to avoid conflicts with JS tween */
	will-change: transform;
}

/* Use flex-basis as thumbnail size and keep square shape with aspect-ratio */
.scroller-item {
	flex: 1 1 360px; /* larger default square thumbnails */
	aspect-ratio: 1 / 1; /* maintain square */
	transition: flex-basis 800ms cubic-bezier(0.22, 1, 0.36, 1), height 800ms cubic-bezier(0.22, 1, 0.36, 1);
	overflow: visible;
}

.scroller-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0; /* no rounded corners */
	display: block;
	transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 600ms cubic-bezier(0.22, 1, 0.36, 1);
	transform-origin: top center; /* grow downward from top */
}

/* When hovering the whole scroller, slightly shrink non-hovered thumbnails */

	/* no-op: keep thumbnails size when hovering the scroller area */
	/* Intentionally empty to avoid shrinking the whole bar on container hover */


/* The hovered thumbnail grows square; others will move aside due to flex basis change */
.projects-scroller .scroller-item:hover {
	flex-basis: 700px; /* reduced growth to be less aggressive */
}

.projects-scroller .scroller-item:hover img {
	transform: scale(1.01);
	box-shadow: 0 14px 36px rgba(17,17,17,0.16);
	z-index: 5;
}

/* Pause scrolling on hover of the scroller area (desktop) */
.projects-scroller:hover .scroller-track {
	animation-play-state: paused;
}

/* Theme Toggle Button */
.theme-toggle {
	background: transparent !important;
	border: none !important;
	color: var(--bs-body-color);
	padding: 0.5rem !important;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.3s;
}

.theme-toggle:hover {
	color: var(--bs-primary);
}

.theme-toggle .sun-icon {
	display: block;
}

.theme-toggle .moon-icon {
	display: none;
}

body.dark-mode .theme-toggle .sun-icon {
	display: none;
}

body.dark-mode .theme-toggle .moon-icon {
	display: block;
}

@keyframes scroll-left {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

/* ensure images remain accessible on small screens */
@media (max-width: 575.98px) {
	.scroller-item { flex-basis: 130px; }
	.projects-scroller .scroller-item:hover { flex-basis: 180px; }
}

/* --------------------------------------------------------------------------
   Image Lightbox Modal
   -------------------------------------------------------------------------- */
.image-lightbox {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.9);
	z-index: 1000;
	align-items: center;
	justify-content: center;
}

.image-lightbox.active {
	display: flex;
}

body.dark-mode .image-lightbox {
	background: rgba(0, 0, 0, 0.95);
}

.lightbox-content {
	position: relative;
	max-width: 90%;
	max-height: 90%;
	display: flex;
	align-items: center;
	justify-content: center;
}

#lightboxImage {
	max-width: 100%;
	max-height: 85vh;
	object-fit: contain;
	border-radius: 0;
}

.lightbox-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: none;
	border: none;
	color: white;
	font-size: 3rem;
	cursor: pointer;
	transition: color 0.3s;
	z-index: 1010;
}

.lightbox-close:hover {
	color: #ccc;
}

.lightbox-prev,
.lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.3);
	color: white;
	border: none;
	padding: 15px 20px;
	font-size: 2rem;
	cursor: pointer;
	transition: background 0.3s;
	border-radius: 0;
	z-index: 1010;
}

.lightbox-prev {
	left: -70px;
}

.lightbox-next {
	right: -70px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
	background: rgba(255, 255, 255, 0.6);
}

.lightbox-counter {
	position: absolute;
	bottom: -40px;
	left: 50%;
	transform: translateX(-50%);
	color: white;
	font-size: 1rem;
	white-space: nowrap;
}

@media (max-width: 768px) {
	.lightbox-prev,
	.lightbox-next {
		padding: 10px 15px;
		font-size: 1.5rem;
	}

	.lightbox-prev {
		left: 10px;
	}

	.lightbox-next {
		right: 10px;
	}

	.lightbox-close {
		top: 10px;
		right: 10px;
	}

	.lightbox-counter {
		bottom: 10px;
		transform: translateX(-50%);
	}
}

/* --------------------------------------------------------------------------
   Remove decorative colored background/shapes from hero for clean white look
   -------------------------------------------------------------------------- */
.hero-bg {
	background: transparent !important;
}

.floating-shapes,
.shape,
.shape-1,
.shape-2,
.shape-3 {
	display: none !important;
}



