body {
    margin: 0;
    padding: 0;
    font-family: "Nunito Sans", Arial, sans-serif;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

.page-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

#header {
    width: 100%;
    border: 0px solid #000000;
}
#header a {
	text-decoration: none;
	color: #00aeef;
}
#header a:hover {
	color: #a2abab;
}

#main-eyebrow {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: left;
    padding-bottom: 16px;
    color: #00aeef;
    padding: 40px 200px 0 86px;
    transition: all 0.3s ease;
}

#main-title {
    font-size: clamp(72px, 8vw, 120px);
    font-weight: 900;
    line-height: 8vw;
    padding: 10px 200px 10px 80px;
    transition: all 0.3s ease;
}

#main-description {
    font-size: clamp(18px, 1.5vw, 28px);
    font-weight: 500;
    padding: 0px 300px 50px 80px;
    transition: all 0.3s ease;
}

#bottom-eyebrow {
    font-size: clamp(10px, 1.5vw, 14px);
    font-weight: 700;
    text-transform: uppercase;
    text-align: left;
    padding-bottom: 16px;
    color: #00aeef;
    padding: 10px 10px 12px 44px;
}

#bottom-title {
    font-size: clamp(36px, 4.8vw, 90px);
    font-weight: 900;
    line-height: 1;
    padding: 0 10px 14px 40px;
}

#bottom-description {
    font-size: clamp(18px, 1.5vw, 28px);
    font-weight: 500;
    padding: 0 80px 20px 40px;
}

.lower-case {
    text-transform: lowercase !important;
}

.black {
    color: black !important;
}

.small-text {
    font-size: 18px;
    color: #e8c8e6;
}

.strike {
    text-decoration: line-through;
    color: #a2abab;
}

.container {
    width: 100%;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.third-row-container {
    width: 100%;
    height: 50vh;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
    display: flex;
    gap: 20px;
}

.case-study-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 20px;
    height: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
}

.third-row-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
    height: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
}

.third-row-content {
    flex: 2;
    height: 100%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
}

.case-study-card {
    perspective: 1000px;
    position: relative;
    height: 100%;
    z-index: 1;
}

.case-study-card:hover {
    z-index: 10;
}

.card-flip-container {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.case-study-card:hover .card-flip-container {
    transform: rotateY(180deg);
}

.card-2:hover .card-flip-container {
    transform: rotateX(180deg);
}

.card-5:hover .card-flip-container {
    transform: rotateX(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-back {
    padding: 0px;
}

.card-front {
    color: black;
    z-index: 2;
}

.card-front h3 {
    margin: 0;
    font-size: 1.2em;
    text-align: center;
}

.card-back {
    background-color: white;
    color: black;
    transform: rotateY(180deg);
}

.card-2 .card-back {
    transform: rotateX(180deg);
}

.card-5 .card-back {
    transform: rotateX(180deg);
}

.card-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.card-2 {
    grid-column: 3 / 5;
    grid-row: 1 / 2;
}

.card-3 {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

.card-4 {
    grid-column: 4 / 5;
    grid-row: 2 / 5;
}

.card-5 {
    grid-column: 2 / 4;
    grid-row: 3 / 5;
}

.card-6 {
    grid-column: 1 / 2;
    grid-row: 3 / 5;
}

.card-7 {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

.card-1 .card-front {
    background: #ffffff;
}

.card-2 .card-front {
    background: white;
}

.card-3 .card-front {
    background: white;
}

.card-4 .card-front {
    background: #ffffff;
}

.card-5 .card-front {
    background: #ffffff;
}

.card-6 .card-front {
    background: #ffffff;
}

.card-7 .card-front {
    background: #ffffff;
}

.card-content {
    width: 100%;
    height: 100%;
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
}

.eyebrow {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    text-align: center;
    padding-bottom: 10px;
    color: #00aeef;
}

.headline {
    font-size: 40px;
    font-weight: 900;
    line-height: 44px;
    text-align: center;
    padding: 0;
}

.turn {
    font-size: 50px;
    font-weight: 900;
    position: absolute;
    bottom: 14px;
    right: 10px;
    width: 50px;
    height: 50px;
    color: #777b86;
}

.panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    box-sizing: border-box;
    padding: 10%;
    z-index: 2;
}

.button {
    display: absolute;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    padding: 14px 20px;
    border: 1px solid #ffffff;
    border-radius: 8px;
}

.button:hover {
    background-color: rgba(255, 255, 255, .9);
    border: 0px solid #ffffff;
    color: #00aeef;
    cursor: pointer;
}

.relative {
    position: relative;
}

.above {
    z-index: 10;
}

.behind {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

#card1-front-image {
    background-image: url(img/govbax-zipper.jpg);
    background-size: cover;
    background-position: top;
    opacity: 0.1;
}

#card1-back-image {
    width: 100%;
    height: 100%;
    background-image: url(img/govbax-zipper.jpg);
    background-size: cover;
    background-position: top;
    opacity: 1;
}

#card1-front .headline {
    padding-left: 20px;
    padding-right: 20px;
}

#card2-front .headline {
    width: 100%;
    border: 0px solid #ff5500;
}

#card2-front .eyebrow {
    color: #f5f5f5 !important;
    margin-top: -16px !important;
}

#card2-front .headline {
    font-size: 70px;
    padding-top: 10px;
    color: #f5f5f5;
    line-height: 1em;
}

#card2-back .headline {
    font-size: 80px;
    padding-top: 10px;
    line-height: 1em;
}

#card2-back .eyebrow {
    margin-top: -10px !important;
}

#title-card {
    background-color: #373F51 !important;
    color: white;
}

#card3-front {
    width: 100%;
    height: 100%;
    background: url(img/frank-color-logo.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

#card3-back-image {
    width: 100%;
    height: 100%;
    background-image: url(img/frank-portrait3.jpg);
    background-size: cover;
    background-position: center 40%;
    opacity: 1;
}

#card4-front-image {
    background-image: url(img/mfa-cat-logo.jpg);
    background-size: cover;
    background-position: center;
    opacity: .1;
}

#card4-back-image {
    width: 100%;
    height: 100%;
    background-image: url(img/mfa-cat-logo.jpg);
    background-size: cover;
    background-position: center;
    opacity: 1;
}

#card4-front .headline {
    padding-left: 10px;
    padding-right: 10px;
}

#card5-front-image {
    background-image: url(img/pp-screens.jpg);
    background-size: cover;
    background-position: top;
    opacity: 0.1;
}

#card5-back-image {
    width: 100%;
    height: 100%;
    background-image: url(img/pp-screens.jpg);
    background-size: cover;
    background-position: top;
    opacity: 1;
}

#card6-front-image {
    background-image: url(img/HBG-logo-LG.jpg);
    background-size: cover;
    background-position: 30% top;
    opacity: 0.1;
}

#card6-back-image {
    width: 100%;
    height: 100%;
    background-image: url(img/HBG-logo-LG.jpg);
    background-size: cover;
    background-position: 75% top;
    opacity: 1;
}

#card7-front-image {
    background-image: url(img/miravista-sq.jpg);
    background-size: cover;
    background-position: 75% top;
    opacity: 0.1;
}

#card7-back-image {
    width: 100%;
    height: 100%;
    background-image: url(img/miravista-sq.jpg);
    background-size: cover;
    background-position: 75% top;
    opacity: 1;
}

#card7-front .headline {
    padding-left: 20px;
    padding-right: 20px;
}

.corner {
    position: absolute;
    bottom: 24px;
    right: 36px;
    width: 60px;
    height: 60px;
    border-radius: 180px;
    background-color: #ffffff;
    border: 1px solid #282B28;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    z-index: 20;
}

.corner::after {
    content: '';
    background-image: url('img/btn-arrow-bw.png');
    background-size: 200% 100%;
    background-position: 0 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: background-position 0.3s ease;
}

.case-study-card:hover .card-back .corner:hover {
    scale: 1.1;
    background-color: #282B28;
    border: 0px solid #ffffff;
    cursor: pointer;
}

.case-study-card:hover .card-back .corner:hover::after {
    background-position: -100% 0;
}

/* Transition Styles */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    background-color: transparent;
}

.white-panel {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: white;
    transition: transform 0.5s ease-in-out;
}

.top {
    top: 0;
    transform: translateY(0);
    transform-origin: bottom center;
}

.bottom {
    bottom: 0;
    transform: translateY(0);
    transform-origin: top center;
}

.top.animate {
    transform: translateY(-100%);
}

.bottom.animate {
    transform: translateY(100%);
}

.top.animateOut {
    transform: translateY(0);
}

.bottom.animateOut {
    transform: translateY(0);
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

#preloader img {
    width: 48px;
    height: auto;
}

/* Footer */
.site-footer {
    width: 100%;
    height: 140px;
    background-color: #373F51;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
}

.footer-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    box-sizing: border-box;
}

.footer-button {
    padding: 16px 24px 14px 24px;
    background-color: #373F51;
    border: 2px solid #777b86;
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 120px;
    transition: background-color 0.3s ease;
}

.footer-button:hover {
    background-color: #0496e1;
    border: 2px solid #0496e1;
}

.footer-logo {
    text-align: center;
    perspective: 1000px;
}

.footer-logo img {
    width: 60px;
    height: auto;
    margin-bottom: 10px;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
    transform: rotateX(0deg);
}

.footer-logo img.flipping {
    transform: rotateX(360deg);
}

.footer-copyright {
    font-size: 12px;
    color: #e8eaec;
    margin: 0;
}

/* Responsive */
@media (max-width: 980px) {
    body {
        overflow-y: auto;
    }

    .page-wrapper {
        max-width: none;
    }

    #main-eyebrow {
        padding: 20px 20px 0;
        font-size: clamp(12px, 3vw, 16px);
    }

    #main-title {
        padding: 10px 20px;
        font-size: clamp(36px, 8vw, 72px);
        line-height: 1.1;
    }

    #main-description {
        padding: 0 20px 20px;
        font-size: clamp(14px, 3vw, 18px);
    }

    .container {
        height: auto;
        padding: 20px;
    }

    .case-study-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 30px;
        height: auto;
        padding: 0;
    }

    .third-row-container {
        display: block;
        height: auto;
        padding: 0 20px 80px;
    }

    .third-row-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 30px;
        height: auto;
    }

    .third-row-content {
        height: auto;
        margin-top: 30px;
    }

    #bottom-eyebrow {
        padding: 10px 20px 10px;
        font-size: clamp(10px, 2.5vw, 14px);
    }

    #bottom-title {
        padding: 0 20px 10px;
        font-size: clamp(24px, 6vw, 36px);
        line-height: 1.1;
    }

    #bottom-description {
        padding: 0 20px 20px;
        font-size: clamp(14px, 3vw, 18px);
    }

    .card-1, .card-2, .card-3, .card-4, .card-5, .card-6, .card-7 {
        grid-column: auto;
        grid-row: auto;
        min-height: 400px;
    }

    .card-2, .card-3 {
        min-height: 240px;
    }

    .case-study-card:hover .card-flip-container {
        transform: rotateX(180deg);
    }

    .card-back {
        transform: rotateX(180deg);
    }
/*
    .site-footer {
        height: auto;
        padding: 20px 0;
    }
*/    
    .site-footer {
		width: 100vw; /* Full viewport width */
		min-height: 140px; /* Base height for wide screens */
		background-color: #373F51;
		display: flex;
		justify-content: center;
		align-items: center; /* Fine for wide screens */
		z-index: 5;
		position: relative;
	}

	.footer-content {
		max-width: 1200px;
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 40px;
		box-sizing: border-box;
	}

    .footer-button {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    .footer-logo {
        order: -1;
    }
    
   @media (max-width: 980px) {
		.site-footer {
			min-height: 240px; /* Taller base to fit stacked content */
			padding: 40px 0; /* Keep padding for breathing room */
			align-items: flex-start; /* Top-align content, let it flow down */
		}
		.footer-content {
			padding: 0 20px;
			flex-direction: column;
			gap: 20px;
		}
	}
}