/* ==========================================================================
    GLOBAL STYLES
    ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-size: inherit;
}

html{
    /*scroll-snap*/
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    background-color: var(--background); /* Fallback if background.js fails to load */
    line-height: 1.6;
    overflow-x: hidden;
    font-size: var(--font-size);
}

main > section:last-child{
    margin-bottom: 0px;
    padding-bottom: 0px;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

a {
    text-decoration: none;
    color: var(--accent);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* ==========================================================================
    SHARP ANGLE UTILITIES & UI COMPONENTS
    ========================================================================== */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #000;
    font-weight: bold;
    padding: 0px 35px;
    height: 50px;
    line-height: 50px;
    text-transform: uppercase;
    vertical-align: middle;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    /* 30/60 degree inspired angled button */
    clip-path: polygon(15px 0, 100% 0, calc(100% - 15px) 100%, 0 100%);
    border: none;
    font-size: 0.9rem;
}

.btn:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: scale(1.05);
}

.section-container{
    margin: 0px auto;
    position: relative;
    z-index: 10;
    padding: 260px 0px;
}

.section-wrapper{
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--section-padding) 20px;
    
    box-shadow: 0px 0px 10px 10px var(--shadow-color);
}


.section-wrapper p {
    margin-bottom: 1.5rem;
}

.section-wrapper p:last-child{
    margin-bottom: 0;
}

.section-wrapper > div{
    max-width: var(--max-width);
    width: 100%;
    margin: 0px auto;
}

.section-container:first-of-type{
    scroll-snap-stop: always;
}

/* Naked Section - Fully transparent gap to show off canvas */
.naked-section {
    padding: 120px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 5;
}

/* Text Section - Fully Opaque Blocks */
.angled-section {
    background-color: var(--primary); /* Fully opaque */
    position: relative;
}

.section-left,
.section-right{
    max-width: calc(var(--max-width) / 2);
}

.section-left{margin-left: 0px;}
.section-right{margin-right: 0px;}

.section-wrapper.section-left,
.section-wrapper.section-right{min-width: 50vw; max-width: 50vw;}

.section-wrapper.section-left{margin-left: 0px;}
.section-wrapper.section-right{margin-right: 0px;}

.section-wrapper.section-left > div,
.section-wrapper.section-right > div{margin: 0px auto; max-width: calc(var(--max-width) / 2);}

.section-wrapper.section-left > div{margin-right: 0px;}
.section-wrapper.section-right > div{margin-left: 0px;}

/* Corner Cuts */
.cut-top-left {
    clip-path: polygon(var(--corner-size) 0, 100% 0, 100% 100%, 0 100%, 0 var(--corner-size));
}

.cut-top-right {
    clip-path: polygon(0 0, calc(100% - var(--corner-size)) 0, 100% var(--corner-size), 100% 100%, 0 100%);
}

.cut-bottom-left {
    clip-path: polygon(0 0, 100% 0, 100% 100%, var(--corner-size) 100%, 0 calc(100% - var(--corner-size)));
}

.cut-bottom-right {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--corner-size)), calc(100% - var(--corner-size)) 100%, 0 100%);
}

.accent-bar {
    width: 80px;
    height: 4px;
    background-color: var(--accent);
    margin: 0px auto 1.5rem auto;
    transform: skewX(-30deg);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--accent-dark);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
    LAYOUT
    ========================================================================== */
.hero-section{
    max-width: var(--max-width);
    margin: 0px auto;
}

.container {
    margin: 0 auto;
    position: relative;
    z-index: 10;
    max-width: var(--max-width);
}

/* Header / Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    vertical-align: middle;
    z-index: 100;
}

header:before{
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    opacity: 1;
    background: white;
    box-shadow: 0px 0px 10px 10px var(--shadow-color);
    transition: all 300ms ease;
    z-index: -1;
}

body[scroll="0"] header:before{
    opacity: 0;
}

#nav{
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    margin: 0px auto;
}


#nav > .branding{
    position: relative;
    width: 100%;
    height: var(--nav-height);
}

.nav-logo{
    position: absolute;
    transition: all 300ms ease;
    transform-origin: left center;
    top: 10px;
    left: 15px;
}

.nav-links{
    padding: 15px;
}

body[page-name="page_home"][scroll="0"] .nav-logo{
    top: var(--logo-top);
    left: var(--logo-left);
    transform: scale(var(--logo-scale));
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-light);
    display: flex;
    align-items: left;
}

.logo-image{
    position: relative;
    display: inline-block;
    width: 200px;
    height: 60px;
    background-image: var(--logo-image);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
    
    transition: all 300ms ease;
}

.logo-image:after{
    content: "";
    position: absolute;
    top: 2px; right: 0; bottom: -2px; left: 0;
    background-image: var(--logo-image);
    /*this pseudo element is simply a drop shadow for the above logo that can be faded in and out*/
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
    filter: blur(20px) brightness(0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

body[page-name="page_home"][scroll="0"] .logo-image:after{
    opacity: 0.5;
}

.logo span {
    color: var(--accent);
}

/* Hero Section */
#hero {
    height: 60vh;
    display: flex;
    align-items: center;
    background-color: transparent; /* Lets canvas show fully */
    padding: 0 5%;
}

body[page-name="page_home"] #hero {
    height: 100vh;
}

.hero-image{
    position: fixed;
    top: 0px; left: 0px; right: 0px; bottom: 0px;
    display: flex;
    justify-content: center;
    align-items: middle;
    transition: opacity 300ms ease;
    opacity: 0;
}

body[section="0"] .hero-image{
    opacity: 1;
}

.hero-image > span{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: middle;
}


.hero-image > span > img{
    position: relative;
    object-fit: contain;
}


.hero-content {
    position: absolute;
    left: var(--hero-content-left);
    max-width: 800px;
    color: var(--text-light);
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 0.5rem;
    text-shadow: 0px 4px 25px var(--shadow-color);
}

.hero-content h2 {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    margin-bottom: 2rem;
    font-weight: 400;
    text-shadow: 0px 2px 20px var(--shadow-color);
}

/*intro*/
.container.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

/* hex panels */
/*
<div class="hex-panels">
    <div class="hex-panel"><img src="images/originals/H5.PNG"/></div>
    <div class="hex-panel"><img src="images/originals/H6.PNG"/></div>
    <div class="hex-panel"><img src="images/originals/H7.PNG"/></div>
    <div class="hex-panel"><img src="images/originals/H8.PNG"/></div>
    <div class="hex-panel"><img src="images/originals/H9.PNG"/></div>
</div>
*/
/*these hex panels should be displayed in a vertical hexagonal grid formation where every even number is stagered horizontally from the main column, inside hexagons with a coloured stroke*/
.hex-panels {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 320px;
}

.hex-panel {
    position: relative;
    width: 150px;
    height: 130px;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background-color: var(--accent);
    border: 2.5px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transform: scale(0);
    transition: all 0.66s ease;
    transition-delay: 0ms;
    left: 80px;
}

.state-active .hex-panel {
    transform: scale(1.35);
    left: 0px;
}

.state-active .hex-panel:nth-child(even) {
    left: 160px; /* Stagger even panels */
}

.state-below.state-active .hex-panel:nth-child(2){transition-delay: 200ms;}
.state-below.state-active .hex-panel:nth-child(3){transition-delay: 400ms;}
.state-below.state-active .hex-panel:nth-child(4){transition-delay: 600ms;}
.state-below.state-active .hex-panel:nth-child(5){transition-delay: 800ms;}

.state-above.state-active .hex-panel:nth-child(1){transition-delay: 800ms;}
.state-above.state-active .hex-panel:nth-child(2){transition-delay: 600ms;}
.state-above.state-active .hex-panel:nth-child(3){transition-delay: 400ms;}
.state-above.state-active .hex-panel:nth-child(4){transition-delay: 200ms;}

.hex-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); /* Apply clip-path to image as well */
    z-index: -1;
}


/* Intro Section */

.intro-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.team-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.team-card {
    background: var(--secondary);
    padding: 20px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--angle-small)), calc(100% - var(--angle-small)) 100%, 0 100%);

}

.team-photo {
    width: 100%;
    height: 200px;
    background-color: var(--accent);
    margin-bottom: 15px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.team-photo > img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /*black and white until section is active then color*/
    filter: grayscale(100%);
    transition: filter 0.8s ease;
}

.state-active .team-card .team-photo > img {
    filter: grayscale(0%);
}

.team-member-name {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--accent);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.team-member-name:hover {
    color: var(--text-light);
}

.team-member-name i {
    font-size: 0.8rem;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.team-member-name:hover i {
    opacity: 1;
}

.team-card p {
    font-size: 0.85rem;
}

.team-card p > b{
    color: var(--accent);
}

.team-card p > i{
    opacity: 0.7;
}

/*blog post*/
.blog-post > h1{
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--accent-dark);
    margin-bottom: 0.5rem;
}


.blog-content > img{
    display: block;
    width: 100%;
    max-width: 650px;
    max-height: 650px;
    object-fit: contain;
    margin: 0px auto;
}

.blog-content > p{
    margin: 25px 0px;
}

/*blog preview cards*/
.blog-preview-container{
    display: flex;
    margin-top: 30px;
    justify-content: center;
}

.blog-preview-card{
    overflow: hidden;
    width: min(350px,100%);
    border: 2px solid var(--accent);
}

.blog-thumbnail{
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    text-align: left;
}

.blog-thumbnail > img{
    position: absolute;
    top: 0px; right: 0px; bottom: 0px; left: 0px;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-preview-card > div:last-child{
    margin: 12px;
}

.blog-preview-card > div > h3{
    color: var(--accent);
    width: 100%;
    text-align: left;
    margin: 6px 0px;
}

.blog-preview-card > div > p{
    color: var(--text-dark);
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.blog-preview-card > div > a{
    /*more link...*/
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: var(--secondary);
    padding: 40px 30px;
    border-top: 4px solid var(--accent);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--angle-small)), calc(100% - var(--angle-small)) 100%, 0 100%);
    transition: transform 0.3s ease, background 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-icon {
    width: 120px;
    height: 100px;
    background: var(--primary);
    margin: 0px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    color: var(--accent);
    font-size: 3rem;
}

.service-icon i {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

.service-card {
    font-size: 1rem;
}

.service-card > ul{
    border: 1px solid rgba(255,255,255,0.3);
}

.service-card ul li{
    position: relative;
    list-style-type: none;
    font-size: 0.9rem;
    line-height: 1.2rem;
    padding: 6px 0px 6px 25px;
}

.service-card > ul > li:before{
    position: absolute;
    left: 8px;
    content: "•";
    color: var(--accent);
    display: inline-block;
    font-size: 1.6rem;
    line-height: 1.2rem;
    margin-right: 5px;
    vertical-align: top;
}


.service-card ul li:nth-child(odd){
    background: rgba(255,255,255,0.3);
}

.service-card ul li > ul{
    position: relative;
    left: -17px;
    margin: 6px 0px 6px 4px;
    font-style: italic;
    color: var(--accent);
    border-left: 1px solid;
}

.service-card ul li > ul:before{
    content: "";
    color: var(--accent);
    position: absolute;
    top: -10px;
    left: -1px;
    height: 12px;
    border-left: 1px solid;
}

.service-card ul li > ul > li{
    padding-left: 20px;
    color: var(--text-dark);
}

.service-card ul li:last-child{
    margin-bottom: 0;
}

/* Hover animation for icons */
.service-card:hover .service-icon i {
    transform: scale(1.35) rotate(5deg);
    color: var(--accent-hover);
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-align: center;
}

.service-card p {
    color: var(--text-dark);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

/* Contact Form & Chips Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-form-wrapper {
    background: var(--secondary);
    padding: 40px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%);
    border-top: 3px solid var(--accent);
}

.text-content{
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: var(--primary);
    border: 1px solid #374151;
    color: var(--text-light);
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.3s ease;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

.form-control:focus {
    border-color: var(--accent);
}

.form-control option {
    background: var(--primary);
    color: var(--text-light);
}

.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
}

.chip {
    background: var(--accent);
    color: #000;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chip .chip-close {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.chip .chip-close:hover {
    opacity: 1;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.direct-contact-item {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.direct-contact-item i {
    color: var(--accent);
    font-size: 1.2rem;
    margin-top: 5px;
}

.direct-contact-item p {
    color: var(--text-dark);
    margin: 0 0 5px 0;
}

.direct-contact-item strong {
    color: var(--accent-dark);
    display: block;
    margin-bottom: 2px;
}

/* Footer */
footer {
    background: rgba(255,255,255,0.6);
    padding: 40px 5% 20px;
    position: relative;
    z-index: 20;
    border-top: 1px solid #374151;
    color: var(--text-light);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.footer-col p, .footer-col a {
    margin-bottom: 0.5rem;
    display: block;
}

.footer-col a i {
    margin-right: 8px;
    color: var(--accent);
    transition: transform 0.3s ease;
}

.footer-col a:hover i {
    transform: scale(1.2);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .intro-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
    .team-container { grid-template-columns: 1fr; }
    .angled-section { padding: 60px 5%; }
    .naked-section { padding: 8vh 5%; }
}

/* ==========================================================================
    DOM CONTROLLER - CSS TRANSITION STATES
    ========================================================================== */
.sub-block {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* When seen (scrolled past but not fully active) 
    Affects sub-blocks with state-seen, or sub-blocks inside a section with state-seen */
.sub-block.state-seen,
.section-container.state-seen .sub-block {
    opacity: 0.7;
    transform: translateY(15px); /* Slight offset when out of focus */
}

/* Fully visible when active (Overrides state-seen due to CSS hierarchy) 
    Affects sub-blocks with state-active, or sub-blocks inside a section with state-active */
.sub-block.state-active,
.section-container.state-active .sub-block {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delay for deeper depth elements */
.sub-block[depth="2"] { transition-delay: 0.15s; }
.sub-block[depth="3"] { transition-delay: 0.3s; }