@import url('https://fonts.googleapis.com/css?family=Montserrat:300,400,700,800&display=swap');


/* Specify blanket rules for all elements */ 
body { 
    color: #424242;
    background-color: #fff;
	margin: 0;
	padding: 0;
	font: normal 100% Montserrat, Arial, Helvetica, sans-serif;
	width: 100%;
	text-shadow: none;
}

.ui-page-theme-a {
	background-color: #fff;
}
	
.contentfill {
	/*background-color: #fff;*/
	text-shadow: none;
	margin: 0;
	padding: 0;
	width: 100%;
}

    
/* Rules for headings */ 
h1 { 
    font-size: 7.5em; /* 128px / 16px */
	font-weight: 800;
	margin: 0 0 0 -.05em;
	padding: 0;
	line-height: 100%;
	letter-spacing: -.03em;
    } 
h2 { 
    font-size: 3em; /* 48px / 16px */
	font-weight: 800;
	margin: 0 0 1em 0;
	padding: 0;
  } 
h3 { 
    font-size: 1.5em; /* 24px / 16px */
	font-weight: 800;
	margin: 0;
	padding: 0;
  }
  
  
/* Rules for standard elements */
  
ul {
	margin: 0;
	padding: 0;
} 
  
hr {
	background: #eee;
	width: 100%;
	height: 6px; 
	border: none;
	margin: 3em 0; /* Ensures consistent spacing above and below on all platforms */
	padding: 0;
	text-align: center;
    clear: both; /* Prevents overlap on mobile */
}

p {
	padding: 0;
	margin: 0 0 2.5% 0;
	line-height: 150%;
}

abbr, acronym {
	border: 0;
}
  
  
/* Rules for links */ 

a {
	outline: none;
}

a:link { 
    color: #424242;
    text-decoration: none;
  } 

a:hover { 
	color: #424242;
    /*text-decoration: underline;*/
	opacity: 0.6;
  }
  
a:focus {
	color: #424242;
  }
  
a:active { 
	color: #424242;
    text-decoration: none;
  }
  
a:visited { 
	color: #424242;
    text-decoration: none;
  }
  
a img {
	border: none;
}

.button {
	display: inline-block;
	font-size: .9em;
	font-weight: bold;
	padding: 15px 25px;
	margin: 1em auto;
	border-radius: 30px;
	width: 60%;
	border:solid;
    box-shadow: 0 0 0 1px #424242;
	text-align: center;
}

.button:hover {
	opacity: 0.6;
}

.button a {
	color: #424242;
	display:inline-block;
    width:100%;
    height:100%;
}

.button a:visited {
	color: #424242;
}

.button a:hover {
	color: #424242;
	opacity: 100%;
}

#about:before {
display: block;
content: " ";
margin-top: -2.5em;
height: 2.5em;
visibility: hidden;
}

#work:before {
display: block;
content: " ";
margin-top: -2.25em;
height: 2.25em;
visibility: hidden;
}

#contact:before {
display: block;
content: " ";
margin-top: -2.25em;
height: 2.25em;
visibility: hidden;
}

  

/* Index Layout */

#sitenavbar {
	z-index: 150;
	position: fixed;
	background: rgb(66, 66, 66); /* Fall-back for browsers that don't
                                    support rgba */
    background: rgba(66, 66, 66, .95);
	padding: 1.25em 0;
	min-height: 1.25em;
	width: 96%;
	margin: 2%;
	border-radius: 20px;
	/*box-shadow: 0 .1em .2em rgba(0, 0, 0, 0.25);*/
}

#sitenavbar img {
	margin-top: .15em;
}

.sitenavcontainer {
	max-width: 1200px;
	display: block;
    margin-left: auto;
    margin-right: auto;
	padding: 0 3.5%;
}

.sitenavheader {
	float: left;
	font-size: 1.5em; /* 24px / 16px */
	font-weight: bold;
	width: 35%;
}

.sitenavheader a {
	color: #fff;
}

.sitenav {
	float: right;
	text-align: right;
	font-size: .9em;
	font-weight: bold;
	width: 65%;
	padding-top: .6em;
	text-transform: uppercase;
}

ul.sitenavlist {
	list-style: none;
}

ul.sitenavlist li {
	display: inline;
	text-align:right;
	margin: 0 0 0 5%;
}

ul.sitenavlist a {
	color: #fff;
}

.sitenavmenu {
	display: none;
	float: right;
	text-align: right;
}

.sitenavmenu img {
	width: 50%;
	height: 50%;
}

#sitenavsubbar {
	display: none;
	z-index: 151;
	position: fixed;
	background: rgb(66, 66, 66); /* Fall-back for browsers that don't
                                    support rgba */
    background: rgba(66, 66, 66, .95);
	padding: 1.25em 5%;
	min-height: 1.25em;
	width: 82%;
	margin-left: 4%;
	margin-right: 4%;
	margin-top: 4em;
	border-radius: 0 0 20px 20px;
}

#sitenavsubbar a {
	color: #fff;
	margin: 0 0 0 0;
	text-transform: uppercase;
	font-size: .9em;
	font-weight: bold;
}

#sitenavsubbar ul {
	list-style: none;
	width: 100%;
}

#sitenavsubbar li {
	display: inline;
	text-align:center;
	float: left;
	width: 33%;
}

@media screen and (max-width:460px) {

	#sitenavbar {
		width: 92%;
		margin: 4%;
	}
	
	.sitenavcontainer {
	padding: 0 5%;
	}
	
	.sitenav {
		display: none;
	}
	
	.sitenavheader {
		width: 75%;
	}
	
	.sitenavmenu {
		display: inherit;
	}
}

.headeralign {
	width: 100%;
	text-align: left;
}

@media screen and (max-width:768px) {
	.headeralign {
	text-align: center;
}
}

#masthead {
	background-color: #424242;
	color: #fff;
	height: 40em;
	overflow: hidden;
	box-shadow: 0 .1em .2em rgba(0, 0, 0, 0.1);
}

.mastheadcontainer {
	max-width: 1200px;
	display: block;
    margin-left: auto;
    margin-right: auto;
	padding: 0 5%;
}

.mastheadcontainer2 {
	max-width: 1200px;
	display: block;
    margin-left: auto;
    margin-right: auto;
	padding: 0 5%;
	color: #ffffff;
}

.mastheadcontainer2 h2 {
	color: #ffffff;
}

.mastheadcontainer2 a {
	color: #ffffff;
}

.mastheadcontainer2 li {
	margin: 0 0 1em 1.5em;
}


.mastxt {
	float: left;
	padding-top: 14em;
	width: 30%;
}

.mastxt2 {
	float: left;
	padding-top: 8em;
	width: 100%;
}
.introtext {
	font-size: 1.5em;
}

.mastanim {
	float: left;
	clear: both;
	width: 100%;
	text-align: left;
	position: relative;
}

.mastimg {
	float: left;
	padding: 1% 0%;
	width: 100%;
	height: 40em;
	text-align: left;
	position: relative;
}

.mastimg img {
	width: 100%;
	width: auto;
}

@media screen and (max-width:768px) {

	
	.mastxt {
		width: 100%;
		padding-top: 12em;
		text-align: center;
	}
	
	.mastheadcontainer2 {
		padding-left: 10%;
		padding-right: 10%;
	}
	
	.mastheadcontainer2 h2 {
		font-size: 2em;
	}
	
	
	.mastxt  h2{
		padding-top: .5em;
	}
	
	.introtext {
		font-size: 1em;
	}
	
	.mastanim {
		text-align: center;
	}
	
	.mastimg {
		width: 100%;
		text-align: center;
	}
	
	.mastimg img {
		width: 100%;
		height: auto;
		text-align: center;
		padding-top: 0em;
	}
}

.contentcontainer {
	max-width: 1200px;
	display: block;
    margin-left: auto;
    margin-right: auto;
	padding: 0 5%;
}

#aboutsection {
	padding: 7em 0;
	font-size: .875em; /* 14px / 16px */
	margin-bottom: 0em;
    overflow: hidden; /* Clears floats so bottom padding perfectly mirrors top */
}

.abouttext {
	float: left;
	text-align: left;
	width: 45%;
	font-size: 1.3em;
}

.subabouttext {
	float: left;
	text-align: left;
	width: 100%;
	padding-top: 5%;
	font-size: .75em;
}

.aboutlinks {
	float: right;
	text-align: left;
	width: 45%;
}

.aboutlinks ul {
	list-style: none;
	font-size: 1.5em; /* 24px / 16px */
	font-weight: bold;
	margin: 0; /* Zeroed bottom margin to keep centering precise */
}

.aboutlinks li {
	padding: 0;
	height: 5em;
	vertical-align: middle;
	filter: grayscale(100%);
}

a:hover .aboutlinkimg {
		opacity: 0.8;
  }
  
a:active .aboutlinkimg {
		opacity: 0.8;
  }
  
a:focus .aboutlinkimg {
		opacity: 0.8;
  }
  
a:hover .aboutlinktxt {
		opacity: 0.6;
  }
  
a:active .aboutlinktxt {
		opacity: 0.6;
  }
  
a:focus .aboutlinktxt {
		opacity: 0.6;
  }

.aboutlinkimg {
	float: left;
	margin: 0 1em 0 0;
}

.aboutlinktxt {	
	padding: 1.25em 0 0 0;
}

@media screen and (max-width:768px) {
	
	.abouttext {
		width: 100%;
	}
	
	.aboutlinks {
		width: 100%;
		margin: 3em 0 0 0; /* Space shifted to top to push away from text block */
	}
	
	.aboutlinktxt {
		display: none;
	}
	
	.aboutlinks li {
		display: inline;
	}
	
	.aboutlinkimg {
		margin: 0;
		width: 33%;
		text-align: center;
	}
	
	.aboutlinks ul {
		margin: 0;
	}
}

#worksection {
	padding-top: calc(4em + 45px);
	padding-bottom: 4em;
}

ul.worktitle {
	list-style: none;
	display: inline-block;
	width: 100%;
}

ul.worktitle li {
	width: 50%;
}

ul.worktitle .worktext {
	float: left;
}

ul.worktitle .caselink {
	float: right;
	text-align: right;
	font-size: .9em;
	font-weight: bold;
	padding-top: .6em;
	text-transform: uppercase;
}

/* ========================================================= 
   REFINED GRID LAYOUT 
   Uses CSS Grid to perfectly match the 4-column alignment
   across the featured case and lower thumbnails
   ========================================================= */

/* Featured Case Study Styles */
a.featured-case {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 36px; /* Unified gap for perfect squares */
    width: 100%;
    margin-bottom: 36px; /* Matches grid gap precisely */
    background-color: #f9f9f9;
    border-radius: 16px;
    border: 1px solid #eee;
    align-items: stretch; /* Stretches children vertically to match card height */
    text-decoration: none;
    color: #424242;
}

a.featured-case:link, 
a.featured-case:visited, 
a.featured-case:active {
    color: #424242;
}

.featured-thumb {
    grid-column: span 1;
    width: 100%;
    height: 100%;
    position: relative;
}

.featured-thumb .workwrapper,
.featured-thumb .thumb-frame {
    height: 100%;
    width: 100%;
}

.featured-thumb .thumb-frame {
    border-radius: 16px 0 0 16px;
}

.featured-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px 0 0 16px; /* Flat right edge on desktop */
    display: block;
    box-shadow: none; /* Shadow removed so it sits flush in the card */
}

.featured-text {
    grid-column: span 3;
    width: 100%;
    font-size: 1.2em; /* 24px container (1.5em) -> reduced to 1.2em */
    padding: 40px 40px 40px 0; /* No left padding needed because of 3% column gap */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.featured-text h3 {
    margin: 0 0 0.5em 0;
    font-size: 24px; /* FIXED PIXEL SIZE */
    font-weight: 800;
}

/* Lower Work Grid */
ul.worklinks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 36px; /* Unified horizontal and vertical spacing */
    list-style: none;
    margin: 0; /* Zero top margin, lets featured-case bottom margin handle spacing */
    padding: 0;
}

ul.worklinks li {
    width: 100%;
    margin: 0;
    text-align: center;
    display: flex; /* Helps inner card stretch to fit uniform height */
}

ul.worklinks .workwrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

ul.worklinks li a {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 16px;
    text-decoration: none;
    overflow: hidden;
}

ul.worklinks li img {
    width: 100%; 
    height: auto;
    display: block; 
    border-radius: 16px 16px 0 0; /* Flat bottom to mesh with text card */
    box-shadow: none; /* Replaced default shadow with clean card aesthetic */
}

.thumb-frame {
    position: relative;
    border-radius: 16px 16px 0 0; /* Flat bottom */
    overflow: hidden;
    line-height: 0; /* Prevents ghost space under images */
}

/* Badge Container for Multiple Badges */
.badge-container {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    gap: 8px; /* Spacing between side-by-side badges */
    pointer-events: none; /* Allows click through to link */
}

.workbadge {
    position: absolute; /* Default for solitary badges */
    bottom: 12px; 
    left: 12px;   
    z-index: 10;
    background: rgba(255, 255, 255, 0.8); /* 80% white fill */
    color: #424242; /* Dark text #424242 */
    padding: 8px 10px; /* Increased vertical padding to 8px */
    font-size: 0.65em;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700; /* Bold */
    border-radius: 50px; /* Capsule */
    pointer-events: none; /* Allows click through to link */
    box-shadow: none; /* Removed shadows */
}

/* Override absolute positioning when grouped in a container */
.badge-container .workbadge {
    position: relative;
    bottom: auto;
    left: auto;
    z-index: auto;
}

ul.worklinks .worktxt {
    color: #424242;
    font-weight: 700;
    text-align: center;
    flex-grow: 1; /* Pushes text area to fill if cards vary in height */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
}

.workcontent {
    padding: 1.25em 1em; /* Substantial padding gives card a good weight below image */
    margin: 0;
    line-height: 120%;
}

/* Case Call-to-action Button */
.case-button {
    margin-top: 1.5em;
}

.case-button .btn-text {
    display: inline-block;
    padding: 12px 20px; /* Scaled down 20% */
    border: solid; /* Matches .button border */
    box-shadow: 0 0 0 1px #424242; /* Matches .button shadow/border look */
    border-radius: 30px;
    font-weight: bold;
    font-size: 12px; /* Fixed size to match perfectly across varying containers */
    color: #424242 !important; /* Added !important to override jQuery Mobile */
    text-decoration: none;
    width: auto; /* Overrides .button width: 60% if copied */
    transition: opacity 0.2s ease;
}

.case-button .btn-text:hover {
    opacity: 0.6; /* Matches .button hover */
}

.feature-divider {
    height: 3px; 
    margin-top: 2.5%; /* Split 5% gap visually */
    margin-bottom: 2.5%;
    border: none;
    background-color: #eee;
    clear: both;
}

/* Mobile Adjustments for Grid */
@media screen and (max-width:768px) {

    #aboutsection {
        padding: 4em 1em; /* Equal 4em padding applied strictly to top and bottom bounds */
    }

    a.featured-case {
        grid-template-columns: 1fr;
        gap: 24px; /* Tighter gap for stacked elements */
        margin-bottom: 32px; /* Provides breathing room between vertical cards */
    }
    
    .featured-thumb {
        grid-column: span 1;
        width: 100%;
        height: auto;
        margin-bottom: 0;
    }

    .featured-thumb .workwrapper,
    .featured-thumb .thumb-frame {
        height: auto;
        border-radius: 16px 16px 0 0; /* Radius on top only for mobile stacking */
    }
    
    .featured-thumb img {
        width: 100%;
        height: 200px; /* Reduces visual height on mobile */
        object-fit: cover; /* Crops the image to fit */
        border-radius: 16px 16px 0 0; /* Radius on top only for mobile stacking */
    }
    
    .featured-text {
        grid-column: span 1;
        width: 100%;
        padding: 30px 20px 40px 20px;
        align-items: center; /* Centers horizontal flex content like buttons */
        text-align: center;
    }
    
    .featured-text h3 {
        margin-top: 0; 
    }

    .featured-text p {
        font-size: 14px; /* Reduced body copy on mobile */
    }

    ul.worklinks {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px; /* Unified gap for comfortable mobile breathing room */
    }

    .workcontent {
        padding: 1em; /* Equal box padding for mobile cards */
        font-size: 14px; /* Decreased project label size */
		line-height: 140%; /* Optimized spacing for stacked card text */
    }

    .workbadge, .badge-container {
        left: 10px; 
    }
}

@media screen and (max-width:460px) {
    /* Maintained current 2-column override defaults inherited from 768px */
}


/* Work Layout */

#worknavbar {
	z-index: 150;
	position: fixed;
	background: rgb(66, 66, 66);
    background: rgba(66, 66, 66, .95);
	padding: 1.25em 0;
	min-height: 1.2;
	width: 96%;
	margin: 0% 2% 2% 2%;
	border-radius: 20px;
	/*box-shadow: 0 .1em .2em rgba(0, 0, 0, 0.25);*/
}


#worknavbar .worknavheader {
	color: #fff;
}

#worknavbar .worknav {
	float: right;
	text-align: right;
	font-size: .9em;
	font-weight: bold;
	padding-top: .6em;
}

#worktitlebar .worknav {
	float: right;
	text-align: right;
	font-size: .9em;
	font-weight: bold;
	padding-top: .6em;
}

#worktitlebar .worknav a {
	color: #424242;
}

#worknavbar .worknav a {
	color: #fff;
}



#worktitlebar {
	background: rgb(255, 255, 255);
    background: rgba(255, 255, 255, .25);
	padding: 1.25em 0;
	min-height: 1.2;
	width: 96%;
	margin: 2% 2% 2% 2%;
	border-radius: 20px;
	/*box-shadow: 0 .1em .2em rgba(0, 0, 0, 0.25);*/
}

.worknavheader {
	float: left;
	font-size: 1.5em; /* 24px / 16px */
	font-weight: bold;
	color: #424242;
}

#worktitlebar .worknavheader a {
	color: #424242;
}

#worknavbar .worknavheader a {
	color: #fff;
}


.worknavheader a {
	color: #fff;
}


.worknav {
	float: right;
	text-align: right;
	text-transform: uppercase;
}

.worknav img {
	width: 50%;
	margin: 4%;
	}





.worknavtitle {
	float: right;
	text-align: right;
	text-transform: uppercase;
}

.worktitle {
	margin: 0% 0 10% 0;
	width: 50%;
}

@media screen and (max-width:700px) {
	
	#banner {
		height: auto;
	}
	
	#banner img {
		max-width: 85%;
		height: auto;
	}
	
	.worktitle {
		width: 100%;
	}
	
	.worktitle h1 {
		font-size: 4em; /* 128px / 16px */
	}

}


#descriptionsection {
	padding: 3em 0;
	margin: 0;
}

.descriptiontext {
	float: left;
	text-align: left;
	width: 47%;
	font-size: 1.5em; /* 24px / 16px */
	padding-bottom: 5%;
}

.descriptiontext .descriptionlink-desktop {
	display: none;
	text-align: left;
	font-size: .7em;
}

.descriptionlink-desktop .disclaimer {
	display: none;
	text-align: left;
	padding: 0 0 0 0;
}

.descriptionlink-mobile .disclaimer {
	padding: 0 0 0 0;
}

.descriptiontext .descriptionlink-desktop .button {
	display: none;
	width: auto;
	padding-left: 3em;
	padding-right: 3em;
}

.descriptionlink-mobile {
	display: none;
	width: 100%;
	text-align: center;
}

.descriptioncategories {
	float: right;
	text-align: left;
	width: 47%;
	padding-bottom: 3em;
}

.descriptioncategories ul {
	list-style: none;
	font-size: .875em; /* 14px / 16px */
}

.descriptioncategories li {
	margin: .5em 0 1em 0;
}

.descriptionlink {
	display: none;
	text-align: center;
	width: 100%;
}

@media screen and (max-width:768px) {
	
	#descriptionsection {
		padding-left: 2%;
		padding-right: 2%;
		padding-bottom: 3%;
	}
	
	.descriptiontext {
		float: none;
		width: 100%;
	}
	
	.descriptioncategories {
		float:none;
		width: 100%;
		margin: 0 0 5% 0;
		padding: 0;
	}
	
	.descriptiontext .descriptionlink-desktop {
		display: none;
	}
	
	.descriptionlink-mobile {
		display: none;
	}
}

#screensection {
	padding: 0;
	clear: both;
}

ul.screenlinks {
	list-style: none;
	margin: 5% 0 0 -5%;
	font-size: 0;
	vertical-align: top;
}

ul.screenlinks li {
	display: inline-block;
	width: 45%;
	font-size: 16px;
	font-size: 1rem;
	margin: 0 0 5% 5%;
	vertical-align: top;
}

ul.screenlinks li img {
	max-width: 100%;
	height: auto;
	box-shadow: 0 .1em .2em rgba(0, 0, 0, 0.1);
	border-radius: 4%;
}


@media screen and (max-width:460px) {
	
	ul.screenlinks {
		list-style: none;
		margin: 5% 0 0 0;
		font-size: 0;
		vertical-align: top;
	}

	ul.screenlinks li {
		width: 100%;
		margin: 0 0 5% 0;
	}
}

/* Contact */

#contactsection {
	padding: 4em 0;
	margin-bottom: 25em;
}

@media screen and (max-width:768px) {
	#contactsection {
		text-align: center;
		margin-bottom: 0;
		padding-bottom: 0;
	}
}

.contacttext {
	clear: both;
	float: left;
	display: block;
	width:50%;
}


.contactimg {
	float: right;
	display: block;
	width: 50%;
	text-align: center;
}

.contactimg img {
	display: inline;
	width: 100%;
}

@media screen and (max-width:768px) {
	
	.contacttext {
		width:100%;
	}
	
	.contactimg {
  		float: none;
		width: 100%;
		text-align: center;
		margin-top: 40em;
	}
	
	.contactimg img {
		display: inline;
		width: 30%;
	}
}

/* Footer */

#footer {
  	clear: both;
  	background-color: #fff;
  	color: #999;
  	font-size: .75em;
  	padding: 2.5% 5% 2.5% 5%;
	text-align: center;
}

.footercontainer {
	max-width: 1200px;
	display: block;
    margin-left: auto;
    margin-right: auto;
}

.disclaimer {
	clear: both;
	color: #999;
	font-size: .75em;
	padding: 0 5% 10% 5%;
	text-align: center;
}

.disclaimer a {
	font-weight: 700;
}


@media screen and (max-width:768px) {
	
	#footer {
  	padding: 5% 5% 5% 5%;
	}
}

#casenav {
	display: flex;
	gap: 50%;
	align-items: flex-start;
	justify-content: space-between;
	width: 100%;
}


#casenav .button {
	
	padding-left: 0%;
	padding-right: 0%;
}

@media screen and (max-width:460px) {
	
	#casenav {
	gap: 4%;
	}

}

/* Specify rules for print content */ 

.printfill {
	display: none;
}




/* Text animation */

.wordCarousel {
    font-weight: 300;
    color: #eee;
    
}

.wordCarousel .static {
        float: left;
    }
    

.wordCarousel .anim {
        overflow: hidden;
        position: relative;
        float: left;
        height: 65px;
        padding-top: 10px;
        margin-top: -10px;
        
    }

.wordCarousel li {
            color: #eee;
            padding: 0 0 0 14px;
            height: 45px;
            margin-bottom: 45px;
            display: block;
        }

.flip2 { animation: flip2 6s cubic-bezier(0.23, 1, 0.32, 1.2) infinite;  }
.flip3 { animation: flip3 8s cubic-bezier(0.23, 1, 0.32, 1.2) infinite; }
.flip4 { animation: flip4 10s cubic-bezier(0.23, 1, 0.32, 1.2) infinite; }
.flip5 { animation: flip5 12s cubic-bezier(0.23, 1, 0.32, 1.2) infinite; }

@keyframes flip2 {
    0% { margin-top: -180px; }
    5% { margin-top: -90px;  }
    50% { margin-top: -90px; }
    55% { margin-top: 0px; }
    99.99% { margin-top: 0px; }
    100% { margin-top: -180px; }
}

@keyframes flip3 {
    0% { margin-top: -270px; }
    5% { margin-top: -180px; }
    33% { margin-top: -180px; }
    38% { margin-top: -90px; }
    66% { margin-top: -90px; }
    71% { margin-top: 0px; }
    99.99% { margin-top: 0px; }
    100% { margin-top: -270px; }
}

@keyframes flip4 {
    0% { margin-top: -360px; }
    5% { margin-top: -270px; }
    25% { margin-top: -270px; }
    30% { margin-top: -180px; }
    50% { margin-top: -180px; }
    55% { margin-top: -90px; }
    75% { margin-top: -90px; }
    80% { margin-top: 0px; }
    99.99% { margin-top: 0px; }
    100% { margin-top: -360px; }
}

@keyframes flip5 {
    0% { margin-top: -450px; }
    5% { margin-top: -360px; }
    20% { margin-top: -360px; }
    25% { margin-top: -270px; }
    40% { margin-top: -270px; }
    45% { margin-top: -180px; }
    60% { margin-top: -180px; }
    65% { margin-top: -90px; }
    80% { margin-top: -90px; }
    85% { margin-top: 0px; }
    99.99% { margin-top: 0px; }
    100% { margin-top: -450px; }
}

@media screen and (max-width:768px) {
	
.wordCarousel .static {
        float: none;
        }
	
.wordCarousel .anim {
		float: none;
	}
}


/* ==========================================================
   CASE STUDY SPECIFIC STYLES (Merged from work_multiplymortgage.html)
   ========================================================== */

/* * CRITICAL FIX FOR STICKY SIDEBAR 
    * position: sticky fails if ANY parent element has overflow: hidden or auto.
    * jQuery Mobile and some default stylesheets add this to the body and wrappers.
    */
html, body, div[data-role="page"], .ui-page, .printhide, #multiply, .contentfill, .contentcontainer {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

/* Prevents scrolling of the background page when lightbox is open */
.noscroll {
    overflow: hidden !important;
    height: 100vh !important;
    touch-action: none; 
}

/* Title & Page Alignment Adjustments */
.worktitle {
    margin-top: 60px; /* Push the title block down from the header */
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.worktitle h1 {
    line-height: 1.05; /* Tighten multi-line titles */
    margin: 0 0 50px -.05em !important; /* Optical left alignment & push content down */
    padding: 0 !important;
}

/* Two-Column Layout for Desktop */
.case-study-layout {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin: 0 0 40px 0;
    width: 100%;
    align-items: flex-start; /* Required for sticky children in flexbox */
}

.case-study-sidebar {
    padding-bottom: 20px;
    align-self: flex-start;
}

.case-study-subtitle {
    font-size: 24px;
    line-height: 1.4;
    margin-top: 0;
    margin-bottom: 30px;
    color: #333333;
}

/* Desktop Sidebar Toggle Hide */
.details-toggle {
    display: none; /* Hidden on desktop */
}

/* Stacked Sidebar Content */
.sidebar-item {
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.6;
    color: #333333;
}

.sidebar-item b {
    display: block;
    margin-bottom: 4px;
    color: #333333;
}

.nested-list {
    list-style-type: none;
    padding-left: 15px;
    margin: 0;
}

.case-study-content {
    width: 100%;
    color: #333333;
    line-height: 1.7;
}

.article-banner {
    width: 100%;
    height: auto;
    border-radius: 16px; /* Matching the grey container radius */
    margin-bottom: 40px;
    display: block;
}

/* Desktop Grid */
@media (min-width: 850px) {
    .case-study-layout {
        flex-direction: row;
        gap: 60px;
    }
    .case-study-sidebar {
        flex: 0 0 300px;
        position: -webkit-sticky;
        position: sticky;
        top: 120px; /* Offset to stay fixed below the nav header */
        max-height: calc(100vh - 120px);
        border-bottom: none;
    }
    .case-study-content {
        flex: 1;
        min-width: 0; 
    }
}

/* Article specific styling (Base / Desktop) */
.article-section {
    /* Zeroing bottom margin prevents asymmetric margin-collapsing on HR dividers */
    margin-bottom: 0 !important; 
}

.article-section h2 {
    font-size: 2em;
    margin-top: 0;
    margin-bottom: 20px;
    color: #333333;
}

.article-section h3 {
    font-size: 1.4em;
    margin-top: 40px;
    margin-bottom: 15px;
    color: #333333;
}

.article-section h4 {
    font-size: 1.1em;
    margin-top: 25px;
    margin-bottom: 10px;
    color: #333333;
}

.article-section p {
    font-size: 1.1em;
    margin-bottom: 20px;
    color: #333333;
}

.article-section ul.content-list {
    font-size: 1.1em;
    padding-left: 20px;
    margin-bottom: 25px;
    color: #333333;
}

.article-section ul.content-list li {
    margin-bottom: 10px;
}

/* Light gray horizontal rule */
hr.section-divider {
    border: 0;
    height: 3px;
    background-color: #e5e5e5;
    margin: 60px 0; /* Symmetric spacing */
}

/* Rounded Grey Container for Images */
.image-panel {
    background: #f9f9f9;
    padding: 40px; /* Uniform padding on all sides */
    border-radius: 16px;
    border: 1px solid #eee;
    margin: 30px 0;
    box-sizing: border-box;
    width: 100%;
}

/* Single-Row Dynamic Images Logic */
.article-images {
    display: flex;
    flex-wrap: nowrap; /* Forces images onto a single row */
    gap: 20px;
    justify-content: center;
    align-items: flex-start; /* Hugs the images tightly without forced stretching */
    width: 100%;
}

.article-image-item {
    flex: 0 1 auto; /* Allows width to shrink dynamically according to ratio */
    display: flex;
    flex-direction: column;
    min-width: 0; 
}

.article-image-item img {
    max-width: 100%; /* Squeezes horizontally when flex container shrinks */
    height: auto; /* Shrinks vertically in tandem to match the new width */
    max-height: 400px; /* Base uniform height limits on large screens */
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: auto; /* Pushes individual captions cleanly to the bottom */
    cursor: pointer; /* Indicates image is clickable */
    transition: transform 0.2s ease;
}

.article-image-item img:hover {
    transform: scale(1.02); /* Slight pop on hover to encourage interaction */
}

.article-image-caption {
    font-size: 0.9em;
    color: #777;
    margin-top: 15px;
    text-align: center;
    font-style: italic;
}

/* Explicit classes for the complex brand captions layout */
.brand-caption-row {
    display: flex; 
    width: 100%; 
    justify-content: space-between;
}
.brand-caption-single {
    width: calc((100% - 100px) / 6);
}
.brand-caption-group {
    width: calc(((100% - 100px) * 4 / 6) + 60px);
}

/* Results Grid */
.results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 40px 0;
}

.result-item {
    flex: 1 1 200px;
    background: #f9f9f9;
    padding: 40px 20px;
    text-align: center;
    border-radius: 16px;
    border: 1px solid #eee;
}

.result-item h3 {
    font-size: 3em;
    margin: 0 0 10px 0;
    color: #333333;
    font-weight: 800; /* Matched to default.css h3 bold weight */
}

/* Smaller trailing text for results */
.result-suffix {
    font-size: 0.5em;
    font-weight: 800 !important; /* Forces match with numbers */
}

.result-item p {
    margin: 0;
    font-size: 1em;
    color: #333333;
}

/* Callout Box */
.story-continues {
    background: #f4f8ff;
    padding: 40px;
    text-align: center;
    border-radius: 16px;
    margin-top: 60px;
    border: 1px solid #dce8fc;
}

.story-continues h3 {
    margin-top: 0; /* Overrides the 40px margin from .article-section h3 */
    margin-bottom: 15px;
}

/* Callout Box */
.bonus-content {
    background: #f9f9f9;
    padding: 40px;
    text-align: center;
    border-radius: 16px;
    margin-top: 60px;
    border: 1px solid #eee;
}

.bonus-content h3 {
    margin-top: 0; /* Overrides the 40px margin from .article-section h3 */
    margin-bottom: 15px;
}


/* LIGHTBOX OVERLAY STYLES */
#lightbox-overlay {
    display: none; /* Shown via JS */
    flex-direction: column;
    position: fixed;
    z-index: 99999;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.lightbox-top-bar {
    width: 100%;
    height: 80px; /* Safe reserved area for Close button */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 40px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.lightbox-close {
    color: rgba(255,255,255,0.7);
    font-size: 44px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-middle {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 60px; /* Space for desktop arrows */
    box-sizing: border-box;
    min-height: 0; /* Critical for inner image scaling */
}

#lightbox-img {
    max-width: 100%;
    max-height: 100%; /* Fully scaled within the middle safe zone */
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-bottom-bar {
    width: 100%;
    min-height: 80px; /* Safe reserved area for caption/mobile arrows */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 40px 25px 40px;
    box-sizing: border-box;
    flex-shrink: 0;
}

#lightbox-caption {
    color: #ffffff;
    font-size: 1.1em;
    text-align: center;
    font-weight: 300;
}

/* Navigation Arrows */
.lightbox-nav {
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, transform 0.2s;
}

.lightbox-nav:hover, .lightbox-close:hover {
    color: #ffffff;
}

/* Desktop side arrows */
.desktop-nav {
    display: none; /* hidden by default, shown by .has-multiple */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px; /* refined size */
    padding: 20px;
    z-index: 100000;
}

.desktop-nav:active {
    transform: translateY(-50%) scale(0.9);
}

#lightbox-overlay.has-multiple .desktop-nav {
    display: block;
}

.desktop-nav.lightbox-prev { left: 15px; }
.desktop-nav.lightbox-next { right: 15px; }

/* Mobile bottom arrows */
.bottom-nav {
    display: none; /* hidden on desktop */
    font-size: 24px; /* Slightly decreased size */
    padding: 10px 20px;
}

.bottom-nav:active {
    transform: scale(0.9);
}

/* Mobile Overrides */
@media (max-width: 849px) {
    .case-study-layout {
        gap: 25px !important; /* Reduce space so content is pulled up */
    }

    .case-study-sidebar {
        padding-bottom: 0 !important; /* Remove desktop padding */
    }
    
    .case-study-subtitle {
        font-size: 24px !important;
        margin-bottom: 20px;
    }
    
    /* Sidebar Mobile Details Toggle */
    .details-toggle {
        display: block; /* Show on mobile */
        width: 100%; /* Extend to edges of content area */
        box-sizing: border-box;
        margin: 0; /* Remove 30px margin to keep content close */
        background: #f9f9f9;
        border: 1px solid #eee;
        border-radius: 16px; /* Match the banner image corner radius */
        padding: 12px 20px;
        color: #333333;
        font-size: 0.95em;
        cursor: pointer;
        text-align: center;
        transition: background-color 0.2s;
    }
    .details-toggle:active {
        background: #f0f0f0;
    }
    .sidebar-details {
        display: none; /* Hide details block by default */
        margin-top: 25px; /* Spacing between toggle and content when expanded */
    }
    .sidebar-details.expanded {
        display: block;
    }

    .article-section h2 { font-size: 1.6em !important; }
    .article-section h3 { font-size: 1.12em !important; }
    .article-section h4 { font-size: 0.88em !important; }
    .article-section p, 
    .article-section ul.content-list {
        font-size: 0.875em !important; /* Forces 14px on mobile */
    }
    
    hr.section-divider {
        margin: 30px 0 !important;
    }

    .result-item {
        padding: 30px 15px !important;
    }
    .result-item h3 {
        font-size: 2.4em !important; /* 20% smaller than 3em */
    }
    
    .story-continues {
        padding: 25px 15px !important; /* Drastically reduced vertical padding */
    }
	
	.bonus-content {
        padding: 25px 15px !important; /* Drastically reduced vertical padding */
    }

    /* --- Image Grid Refinements specifically for mobile --- */
    .image-panel {
        padding: 20px !important; /* Reduced 50% from 40px to maximize image size */
    }
    .article-images {
        gap: 8px !important; /* Tighter gap to let images expand horizontally */
    }
    .article-image-caption {
        font-size: 10px !important; /* Reduced to explicit 10px */
        margin-top: 8px; /* Tighter spacing below image */
    }

    /* Math adjustments to maintain proportion for complex brand captions with 8px gaps instead of 20px */
    .brand-caption-single {
        width: calc((100% - 40px) / 6) !important; /* 5 gaps of 8px = 40px */
    }
    .brand-caption-group {
        width: calc(((100% - 40px) * 4 / 6) + 24px) !important; /* 3 internal gaps of 8px = 24px */
    }

    /* --- Mobile Lightbox Adjustments --- */
    .lightbox-top-bar {
        height: 60px;
        padding: 0 20px;
    }
    
    .lightbox-close {
        font-size: 38px;
    }

    .lightbox-middle {
        padding: 0 15px; /* Tighter padding on sides for maximum image width */
    }

    .lightbox-bottom-bar {
        padding: 10px 15px 20px 15px;
        justify-content: center;
    }

    #lightbox-overlay.has-multiple .desktop-nav {
        display: none !important; /* Hide floating arrows on mobile */
    }

    #lightbox-overlay.has-multiple .bottom-nav {
        display: block; /* Show bottom arrows inline with caption */
    }

    #lightbox-caption {
        font-size: 0.95em;
        margin: 0 10px; /* Space between arrows and text */
        flex: 1; /* Allows text to flex cleanly between arrows */
        max-width: 250px; /* Prevent over-stretching */
    }
}