/* --- ROOT VARIABLES & RESET --- */
:root {
    --bg-main: #000000;
    --bg-darker: #050505;
    --bg-highlight: #080808;
    --accent: #00A88F;
    --text-white: #FFFFFF;
    --text-gray: #999999;
    --text-muted: #666666;
    --border: #1a1a1a;
    --border-light: #222;
    --radius: 4px;
    --font-sans: 'Montserrat', sans-serif;

    /* THE SYSTEM: Perfectly aligned settings */
    --nav-height: 140px;
    --scroll-offset: 140px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: var(--font-sans);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- GLOBAL SCROLL & BEAM ANCHORING --- */
section,
footer {
    scroll-margin-top: var(--scroll-offset);
    position: relative;
    background-color: var(--bg-main);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    transition: background-color 500ms ease;
}

section:not(.hero):hover,
footer:hover,
section:not(.hero).manual-highlight,
footer.manual-highlight {
    background-color: var(--bg-highlight);
}

/* --- SCROLL BEAM EFFECT --- */
section::before,
section::after {
    content: '';
    position: absolute;
    height: 1px;
    width: 150px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    opacity: 0;
    transition: transform 0.8s ease-in-out, opacity 0.2s ease;
    z-index: 5;
    pointer-events: none;
}

section::before {
    top: 0;
    left: 0;
    transform: translateX(-150px);
}

section::after {
    bottom: 0;
    right: 0;
    transform: translateX(150px);
}

@media (min-width: 1025px) {
    section::before,
    section::after {
        height: 2px;
        width: 60vw;
    }
    section::before {
        transform: translateX(-60vw);
    }
    section::after {
        transform: translateX(60vw);
    }
}

section.beam-active::before {
    opacity: 1;
    transform: translateX(100vw);
}

section.beam-active::after {
    opacity: 1;
    transform: translateX(-100vw);
}

/* --- LOGO BRANDING --- */
.logo { display: flex; align-items: center; height: 100%; }
.logo-link { display: flex; align-items: center; text-decoration: none; }
.header-logo {
    height: 110px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: filter 0.3s ease, transform 0.1s ease;
    filter: brightness(1) drop-shadow(0 0 0 rgba(0, 168, 143, 0));
}
.header-logo:hover { filter: brightness(1.2) drop-shadow(0 0 12px rgba(0, 168, 143, 0.6)); }
.header-logo:active { transform: scale(0.97); filter: brightness(1.4) drop-shadow(0 0 20px rgba(0, 168, 143, 0.9)); }

/* --- HEADER --- */
header {
    background-color: rgba(0, 0, 0, 0.65);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 2px solid var(--border);
    background-image: radial-gradient(ellipse 45% 100% at 15% 50%, rgba(0, 168, 143, 0.08) 0%, transparent 70%);
    transition: background-image 0.1s ease, border-color 0.3s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.nav-container { display: flex; justify-content: space-between; align-items: center; height: var(--nav-height); }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- NAVIGATION LINKS --- */
.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links li a {
    color: var(--text-white);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    transition: color 0.3s ease, transform 0.1s ease;
    position: relative;
    padding-bottom: 8px;
    display: inline-block;
    text-shadow: 3px 4px 3px rgba(50, 50, 50, 0.8);
}

.nav-links li a:hover {
    color: #F0B429;
    text-shadow: 3px 4px 15px rgba(0, 168, 143, 0.8), 3px 4px 3px rgba(50, 50, 50, 0.8);
}

.nav-links li a.active {
    color: var(--accent);
}

.nav-links li a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 168, 143, 0.5);
}

.nav-links li a.active:hover {
    color: #F0B429;
}

.nav-links li a.active:hover::after {
    background-color: #F0B429;
    box-shadow: 0 0 8px rgba(240, 180, 41, 0.5);
}

.nav-links li a:active,
.nav-links li a.active:active {
    color: var(--text-white);
    transform: scale(0.95);
}

.nav-links li a.active:active::after {
    background-color: var(--text-white);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    height: 60vh;
    min-height: clamp(450px, 60vh, 700px);
    display: flex;
    align-items: center;
    background-image: url('../images/hero-bg.jpg');
    background-size: contain;
    background-position: right center;
    background-repeat: no-repeat;
    background-color: var(--bg-main);
    margin-top: var(--nav-height);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.85) 20%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}

.hero-container { position: relative; z-index: 2; width: 100%; }
.hero-content { max-width: 550px; }

.hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.hero-content .tagline {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-gray);
    margin-bottom: 25px;
    font-weight: 400;
}

.hero-content .description {
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: 35px;
    font-weight: 300;
}

.btn-demo {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.btn-demo i { margin-right: 8px; }

.btn-demo:hover {
    background-color: var(--accent);
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(0, 168, 143, 0.4);
}

.btn-demo:active {
    transform: scale(0.94);
    background-color: #007A68;
    border-color: #007A68;
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(0, 168, 143, 0.5);
}

/* --- SERVICES --- */
.services { padding: 60px 0; }

.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); }

.service-card { padding: 20px 40px; text-align: center; }

.service-card:not(:last-child) { border-right: 1px solid var(--border-light); }

.service-icon { font-size: 1.8rem; color: var(--accent); margin-bottom: 20px; }

.service-card h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
    font-variant: small-caps;
    letter-spacing: 0.8px;
}

.service-card p {
    font-size: 0.85rem;
    color: var(--text-gray);
    line-height: 1.6;
    font-weight: 300;
}

/* --- DEMO --- */
.demo-section { padding: 60px 0; }

.demo-grid { display: grid; grid-template-columns: 1fr 3fr; align-items: center; gap: 40px; }

.demo-info h2 {
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.demo-info p { font-size: 0.85rem; color: var(--text-gray); }

.demo-player {
    background-color: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* --- ABOUT SECTION --- */
.about-section { padding: 30px 0; text-align: center; }

.about-content { max-width: 700px; margin: 0 auto; }

.about-content h2 {
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 20px;
}

.about-content p {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.7;
    font-weight: 300;
    margin-bottom: 20px;
}

.about-content p strong {
    color: #aaaaaa;
    font-weight: 500;
}

/* --- ABOUT LAYOUT --- */
.about-photo {
    float: left;
    width: 160px;
    margin: 0 20px 10px 0;
    border: 1px solid var(--border);
    display: block;
}

.about-inner {
    text-align: left;
    max-width: 700px;
    margin: 0 auto;
    overflow: hidden;
}

/* --- GLOBAL FOOTER --- */
footer { padding: 50px 0; }

.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 60px; }

.footer-left h4 {
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--text-white);
    margin-bottom: 12px;
}

.footer-left .email-link {
    color: var(--accent);
    text-decoration: none;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 500;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 20px;
    transition: color 0.2s ease-in-out, transform 0.1s ease;
}

.footer-left .email-link:hover { color: #F0B429; }

.footer-left .email-link:active {
    color: var(--text-white);
    transform: scale(0.98);
}

.collab-text {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.6;
    font-weight: 300;
    margin-bottom: 30px;
    max-width: 400px;
}

.footer-socials { display: flex; gap: 20px; position: relative; z-index: 5; }

.footer-socials a {
    color: var(--text-muted);
    font-size: 1.3rem;
    display: inline-block;
    transition: color 0.3s ease;
    text-decoration: none;
}

.footer-socials a:hover { color: var(--accent); }

.footer-socials a:active {
    color: var(--text-white);
    transform: scale(0.95);
}

/* --- CONTACT FORM --- */
.contact-fieldset {
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 30px;
    background-color: var(--bg-darker);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-fieldset.triple-blink { animation: tripleBlinkOutline 1.2s ease-in-out forwards; }

@keyframes tripleBlinkOutline {
    0%        { border-color: var(--border-light); box-shadow: 0 0 0 rgba(0, 168, 143, 0); }
    16%, 50%  { border-color: var(--accent); box-shadow: 0 0 15px rgba(0, 168, 143, 0.4); }
    33%, 66%  { border-color: var(--border-light); box-shadow: 0 0 0 rgba(0, 168, 143, 0); }
    83%       { border-color: var(--accent); box-shadow: 0 0 15px rgba(0, 168, 143, 0.4); }
    100%      { border-color: var(--border-light); box-shadow: 0 0 0 rgba(0, 168, 143, 0); }
}

.contact-legend {
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0 4px;
    background-color: var(--bg-darker);
}

/* --- DYNAMIC BOTTOM ROW --- */
.form-row-split { display: grid; grid-template-columns: 3fr 1fr; gap: 15px; align-items: center; }

.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    background-color: #0c0c0c;
    border: 1px solid var(--border-light);
    color: var(--text-white);
    padding: 14px 16px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    outline: none;
    resize: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
    background-color: #111;
    box-shadow: 0 0 10px rgba(0, 168, 143, 0.15);
}

.contact-form ::placeholder { color: #555; font-weight: 300; }

.btn-submit {
    width: 100%;
    height: 100%;
    min-height: 47px;
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    background-color: var(--accent);
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(0, 168, 143, 0.3);
}

.btn-submit:active {
    transform: scale(0.94);
    background-color: #007A68;
    border-color: #007A68;
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(0, 168, 143, 0.5);
}

/* --- STATUS MESSAGE --- */
#form-status {
    display: none;
    font-size: 1.1rem;
    color: var(--accent);
    text-align: center;
    padding: 40px 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: fadeIn 0.4s ease forwards;
}

#form-status.visible { display: block !important; }

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .services-grid { grid-template-columns: 1fr; }
    .service-card:not(:last-child) { border-right: none; border-bottom: 1px solid var(--border-light); }
    .demo-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 80px;
        --scroll-offset: 80px;
    }

    .menu-toggle { display: block; }

    .about-content p {
        text-align: justify;
    }

    .logo,
    .menu-toggle {
        position: relative;
        z-index: 1;
    }

    header.menu-open {
        border-bottom-color: transparent;
        background-color: transparent !important;
        background-image: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* --- MOBILE DROPDOWN MENU PANEL --- */
    .nav-links {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.60);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        background-image: radial-gradient(ellipse 80% 280% at 15% 40px, rgba(0, 168, 143, 0.08) 0%, transparent 65%);
        flex-direction: column;
        text-align: center;
        padding: calc(var(--nav-height) + 15px) 0 25px 0;
        border-bottom: none;
        z-index: -1;
    }

    .nav-links.active {
        display: flex;
        border-bottom: 2px solid var(--accent);
    }

    .nav-links li { margin: 15px 0; }
    .header-logo { height: 60px; }

    /* --- MOBILE BEAM EFFECT --- */
    section::before,
    section::after {
        height: 3px;
        width: 75vw;
        background: linear-gradient(to right, transparent, var(--accent), transparent) !important;
    }

    section::before {
        top: 0;
        left: 0;
        transform: translateX(-75vw);
    }

    section::after {
        bottom: 0;
        right: 0;
        transform: translateX(75vw);
    }

    section.beam-active::before {
        opacity: 1;
        transform: translateX(100vw);
    }

    section.beam-active::after {
        opacity: 1;
        transform: translateX(-100vw);
    }

    /* --- MOBILE FOOTER --- */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
    }

    .footer-left {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .collab-text {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-socials { justify-content: center; }

    /* --- CONTACT FORM RESPONSIVE --- */
    .form-row-split {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.contact-fieldset.hidden { display: none !important; }