/* Base Styles */
:root {
    --dark-red: #95182e;
    --red: #7d0808;
    --light-grey: #ededed; /* Used for button text on hover */
    --medium-grey: #cccccc; 
    --dark-grey: #333333;
    --white: #ffffff;
    --off-white: #f0f0f0; /* Updated from #f9f9f9 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

/* Helvetica Now font-face */
@font-face {
    font-family: 'Helvetica Now';
    src: url('assets/fonts/helvetica-now.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Helvetica Now', 'Inter', Arial, Helvetica, sans-serif;
    color: var(--dark-grey);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 4rem;
}

h2 {
    font-size: 2.2rem;
    text-align: center; 
    margin: 0 auto 40px auto; 
    position: relative;
    display: table; 
}

h2:after {
    content: '';
    display: block;
    width: 80%; 
    max-width: 200px; 
    min-width: 80px; 
    height: 3px;
    background-color: var(--dark-red);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%); 
}


h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 20px;
}

a {
    text-decoration: none;
    color: var(--dark-red);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--red);
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

section {
    padding: 80px 0;
}

/* Manually set background for specific sections */
#about, #how-it-works, #contact { 
    background-color: var(--off-white); 
}
#our-solution, #future-vision, .hero /* Hero is already white by default */ { 
    background-color: var(--white);
}


/* Navigation */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo img {
    height: 40px;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-item {
    margin-left: 25px; 
    color: var(--dark-grey);
    font-weight: 500;
    position: relative;
    font-size: 0.95rem; 
}

.nav-item:hover, .nav-item.active {
    color: var(--dark-red);
}

.nav-item:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--dark-red);
    transition: width 0.3s ease;
}

.nav-item:hover:after, .nav-item.active:after {
    width: 100%;
}

.linkedin-button {
    margin-left: 25px; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    background-color: var(--dark-red);
    transition: background-color 0.3s ease;
}

.linkedin-button img {
    height: 18px;
    width: 18px;
    filter: brightness(0) invert(1);
}

.linkedin-button:hover {
    background-color: var(--red);
}

/* Hero Section */
.hero {
    position: relative;
    height: 90vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 1;
    will-change: transform;
    transition: transform 0.3s ease-out;
}

.background-geometry {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    opacity: 0.12;
    transform-origin: center;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.background-geometry img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero .container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    transition: all 0.3s ease-out;
    will-change: transform, opacity;
}

.hero-content.centered {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-content h1 {
    color: var(--dark-red);
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.cta-button {
    display: inline-block;
    padding: 14px 30px;
    background-color: var(--dark-red);
    color: var(--white); 
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.3s ease, color 0.3s ease, background-color 0.3s ease; 
    position: relative;
    z-index: 2;
}

.cta-button:hover {
    transform: scale(1.05); 
    color: var(--light-grey); 
    background-color: var(--red); 
}


/* Vision Section (About) */
.vision { 
    position: relative;
    z-index: 2;
    clip-path: inset(0);
}

.vision-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.2rem;
}

/* "Our Solution" section with ID our-solution */
.problem-content { 
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 50px;
    align-items: stretch; /* This makes both columns take the same height */
}

.problem-text { 
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
}

.problem-image-container { 
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    min-height: unset;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px; 
    margin-top: 30px; 
}

.feature-item {
    padding: 20px; 
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    text-align: center;
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    height: 100%; 
}
.feature-item p {
    font-size: 0.9rem; 
    line-height: 1.5;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    background-color: rgba(0, 0, 0, 0.01);
}

.feature-item h4 {
    margin-bottom: 10px; 
    font-size: 1.05rem; 
}

.text-primary {
    color: var(--dark-red);
}

.text-bold {
    font-weight: 700;
}

.text-center {
    text-align: center;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--dark-grey);
    font-weight: 700;
}

/* Underline with theme red color and animation */
.text-underline {
    position: relative;
    color: inherit;
    text-decoration: none;
}
.text-underline::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    bottom: -0.7px;
    height: 2px;
    width: 100%;
    background: var(--dark-red);
    border-radius: 2px;
    z-index: 1;
    transform: scaleX(1);
    transform-origin: left;
    transition: none;
}
.text-underline:hover::after, .text-underline:focus::after {
    animation: underline-reveal 0.35s cubic-bezier(0.4,0,0.2,1);
}
@keyframes underline-reveal {
    0% {
        transform: scaleX(0);
    }
    100% {
        transform: scaleX(1);
    }
}

/* How It Works Section - ID how-it-works */
.how-it-works .workflow { 
    display: grid;
    grid-template-columns: repeat(4, 1fr);  
    gap: 30px;
    margin-bottom: 0; 
}

.how-it-works .workflow-step { 
    text-align: center;
    padding: 25px 20px; 
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.how-it-works .workflow-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.how-it-works .step-number { 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px; 
    height: 45px; 
    background-color: var(--dark-red);
    color: white;
    border-radius: 50%;
    font-size: 1.3rem; 
    font-weight: 600;
    margin: 0 auto 20px auto; 
}

.how-it-works .workflow-step img {
    max-width: 180px; 
    height: 130px;    
    object-fit: contain;
    margin-bottom: 20px; 
}

/* Style for the Optical Sensor image */
.optical-sensor-image {
    border: 1px solid #dddddd; /* Very thin outline */
    border-radius: 6px;      /* Very lightly curved borders */
}

.how-it-works .workflow-step h3 { 
    font-size: 1.2rem; 
    color: var(--dark-red);
    margin-bottom: 10px;
}

.how-it-works .workflow-step p {
    font-size: 0.9rem; 
    flex-grow: 1; 
    line-height: 1.5;
}


/* Future Vision Section - ID future-vision */
.future-vision .container p { 
    font-size: 1.2rem; 
    line-height: 1.7;
}


/* Contact Section - ID contact */
.contact-content {
    display: flex; 
    justify-content: center; 
    max-width: 1000px; 
    margin: 0 auto; 
}

.contact-info {
    padding: 30px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    width: 100%; 
    max-width: 800px; 
    text-align: center; 
}

.contact-details {
    margin-top: 30px;
}

.contact-item {
    margin-bottom: 20px;
}
.contact-item p {
    margin-bottom: 0; 
}

/* Footer */
footer {
    background-color: var(--dark-grey);
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.footer-logo img {
    height: 40px;
}

/* Footer logo: white by default, revert to original on hover */
.logo-white {
    filter: brightness(0) invert(1);
    transition: filter 0.3s cubic-bezier(0.4,0,0.2,1);
}
.logo-white:hover {
    filter: brightness(1) invert(0);
}

.footer-links {
    display: flex;
    gap: 15px; 
    flex-wrap: wrap; 
    justify-content: center; 
}
/* Footer links: white by default, red on hover */
.footer-links a {
    color: white;
    opacity: 0.8;
    transition: color 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s cubic-bezier(0.4,0,0.2,1);
}
.footer-links a:hover {
    color: var(--dark-red);
    opacity: 1;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: var(--dark-red);
}

.social-links img {
    height: 18px;
    width: 18px;
    filter: brightness(0) invert(1);
}

.copyright {
    text-align: center;
    opacity: 0.5;
    font-size: 0.9rem;
}


/* AI Icon Styles */
.ai-icon-wrapper {
    display: inline-block;
    position: relative;
    top: -0.7em;
    left: -0.3em;
    vertical-align: middle;
}

.ai-icon-red {
    height: 1em;
    width: 1em;
    color: var(--dark-red) !important; /* this doesn't work for some reason; just hard coded the colour in the SVG file */
    display: inline-block;
    vertical-align: middle;
}


/* Arterial Line Image */
.arterial-line-image {
    width: 100%;
    max-width: 500px;
    max-height: 400px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
    background: none;
}
.arterial-line-image:hover {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 992px) { /* Medium devices (tablets, less than 992px) */
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .problem-content { 
        grid-template-columns: 1fr; 
    }
    
    .problem-image-container { 
        order: -1; 
        margin-top: 30px; 
        margin-bottom: 0;
        padding: 25px; 
        min-height: 300px; /* Adjust min-height for stacked view */
    }
    
    .features-grid { 
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); 
    }
    
    .hero {
        height: auto;
        min-height: 500px; 
        padding: 100px 0; 
    }

    .how-it-works .workflow {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    }
}

@media (max-width: 768px) { /* Small devices (landscape phones, less than 768px) */
    .nav-links {
        display: none; 
    }
    
    h1 {
        font-size: 2.2rem; 
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 60px 0;
    }
    
    .how-it-works .workflow {
        grid-template-columns: 1fr; 
    }
    .problem-image-container {
        padding: 20px;
        min-height: 250px; /* Further adjust for smaller screens */
    }
     .features-grid {
        grid-template-columns: 1fr; 
    }
}

@media (max-width: 576px) { /* Extra small devices (portrait phones, less than 576px) */
       
    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    .cta-button {
        font-size: 0.9rem;
        padding: 12px 25px;
    }
    .problem-text {
        text-align: center; 
    }
    .problem-text .section-subtitle {
        margin-left: auto;
        margin-right: auto; 
    }
    .how-it-works .workflow-step img {
        max-width: 150px;
        height: 100px;
    }
    .problem-image-container {
        min-height: 200px; /* Adjust for very small screens */
    }
}