/*
Theme Name: Meritage Group Theme
Author: Gemini
Description: A custom theme for Meritage Group, designed for performance and maintainability.
Version: 1.0
*/

:root {
    --color-dark-primary: #0A0A10;
    --color-dark-secondary: #1A1A2E;
    --color-accent-purple: #60519b;
    --color-accent-teal: #00AFB9;
    --color-light-bg: #D1DBE4;
    --color-text-light: #EAEAEA;
    --color-text-muted: #a0aec0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-dark-primary);
    color: var(--color-text-light);
    overflow-x: hidden;
    cursor: none; /* Hide the default cursor */
}

h1, h2, h3, .font-display {
    font-family: 'Exo 2', sans-serif;
    letter-spacing: 0.05em;
}

/* --- Live Animated Logo --- */
.live-logo .logo-shape {
    animation: logo-pulse 4s infinite ease-in-out;
}
@keyframes logo-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; filter: drop-shadow(0 0 2px var(--color-accent-teal)); }
    50% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 5px var(--color-accent-teal)); }
}
.live-logo .logo-shape:nth-child(2) { animation-delay: -1s; }
.live-logo .logo-shape:nth-child(3) { animation-delay: -2s; }
.live-logo .logo-shape:nth-child(4) { animation-delay: -3s; }


/* --- Custom Cursor --- */
.custom-cursor, .cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    backface-visibility: hidden; /* Performance boost */
    filter: blur(1px); /* Subtle blur for glow effect */
}
.custom-cursor {
    width: 6px; /* Slightly smaller */
    height: 6px; /* Slightly smaller */
    background-color: var(--color-accent-teal);
    box-shadow: 0 0 5px var(--color-accent-teal), 0 0 10px var(--color-accent-teal); /* Glow */
    transition: transform 0.1s cubic-bezier(0.19, 1, 0.22, 1);
    animation: pulse-teal 2s infinite ease-in-out; /* Pulsing glow */
}
.cursor-follower {
    width: 30px; /* Slightly smaller */
    height: 30px; /* Slightly smaller */
    border: 2px solid var(--color-accent-purple);
    box-shadow: 0 0 5px var(--color-accent-purple), 0 0 10px var(--color-accent-purple); /* Glow */
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1), background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    animation: pulse-purple 3s infinite ease-in-out; /* Pulsing glow */
}

/* Cursor hover state */
body.link-hover .cursor-follower {
    transform: translate(-50%, -50%) scale(1.4); /* Slightly larger on hover */
    background-color: rgba(96, 81, 155, 0.3);
    border-color: var(--color-accent-teal);
    box-shadow: 0 0 8px var(--color-accent-teal), 0 0 20px var(--color-accent-teal); /* Stronger glow */
    animation: pulse-teal-strong 2s infinite ease-in-out;
}
body.link-hover .custom-cursor {
    transform: translate(-50%, -50%) scale(0.5); /* Shrink dot more */
    opacity: 0.5; /* Fade out dot */
    box-shadow: 0 0 2px var(--color-accent-purple), 0 0 5px var(--color-accent-purple);
    animation: pulse-purple-strong 1.5s infinite ease-in-out;
}
a, button, input, textarea, select {
    cursor: none;
}

/* Cursor glow animations */
@keyframes pulse-teal {
    0%, 100% { box-shadow: 0 0 5px var(--color-accent-teal), 0 0 10px var(--color-accent-teal); }
    50% { box-shadow: 0 0 8px var(--color-accent-teal), 0 0 15px var(--color-accent-teal), 0 0 20px rgba(0, 175, 185, 0.3); }
}
@keyframes pulse-purple {
    0%, 100% { box-shadow: 0 0 5px var(--color-accent-purple), 0 0 10px var(--color-accent-purple); }
    50% { box-shadow: 0 0 8px var(--color-accent-purple), 0 0 15px var(--color-accent-purple), 0 0 20px rgba(96, 81, 155, 0.3); }
}
 @keyframes pulse-teal-strong {
    0%, 100% { box-shadow: 0 0 8px var(--color-accent-teal), 0 0 20px var(--color-accent-teal); }
    50% { box-shadow: 0 0 12px var(--color-accent-teal), 0 0 30px var(--color-accent-teal), 0 0 40px rgba(0, 175, 185, 0.4); }
}
@keyframes pulse-purple-strong {
    0%, 100% { box-shadow: 0 0 5px var(--color-accent-purple), 0 0 10px var(--color-accent-purple); opacity: 0.5;}
    50% { box-shadow: 0 0 8px var(--color-accent-purple), 0 0 15px var(--color-accent-purple), 0 0 20px rgba(96, 81, 155, 0.3); opacity: 0.8;}
}


/* --- Live Background Canvas --- */
#live-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
.content-on-top {
    position: relative;
    z-index: 1;
}
.hero-section {
    position: relative;
    overflow: hidden;
}

/* --- Custom Styles & Animations --- */
.gradient-text {
    background: linear-gradient(90deg, var(--color-accent-purple), var(--color-accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-bg-pattern {
    background-color: var(--color-dark-secondary);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2360519b' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.nav-link.active {
    color: var(--color-accent-teal);
    font-weight: 600;
}

.glow-button {
    background-color: var(--color-accent-teal);
    box-shadow: 0 0 5px var(--color-accent-teal), 0 0 15px var(--color-accent-teal);
    transition: all 0.3s ease-in-out;
}
.glow-button:hover {
    box-shadow: 0 0 10px var(--color-accent-teal), 0 0 30px var(--color-accent-teal);
    transform: scale(1.05);
}

.animate-on-scroll {
     opacity: 0;
     transition: opacity 0.8s ease-out, transform 0.8s ease-out;
     transform: translateY(40px);
}

.is-visible {
     opacity: 1;
     transform: translateY(0);
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

.glass-card {
    background: rgba(26, 26, 46, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease-in-out;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(0, 175, 185, 0.5);
}

@keyframes subtle-glow {
    0% { box-shadow: 0 0 15px rgba(0, 175, 185, 0.2); }
    50% { box-shadow: 0 0 25px rgba(96, 81, 155, 0.3); }
    100% { box-shadow: 0 0 15px rgba(0, 175, 185, 0.2); }
}

.glowing-card {
    animation: subtle-glow 5s infinite ease-in-out;
}

/* Scrolled Header Style */
#main-header.scrolled {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    background-color: rgba(10, 10, 16, 0.9);
}
#main-header.scrolled svg {
    height: 1.75rem;
}

/* Modal Styling */
.modal-bg {
    background-color: rgba(10, 10, 16, 0.7);
    backdrop-filter: blur(5px);
}

/* Spinner for Gemini API loading */
.loader {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: var(--color-accent-teal);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* New Form Styles */
.form-group {
    position: relative;
    margin-bottom: 1rem;
}
.form-input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.375rem;
    background-color: var(--color-dark-secondary);
    color: var(--color-text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}
.form-input:focus {
    outline: none;
    border-color: var(--color-accent-teal);
    box-shadow: 0 0 10px rgba(0, 175, 185, 0.5);
}
.form-label {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    pointer-events: none;
    transition: all 0.2s ease;
    color: var(--color-text-muted);
}
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label,
.form-input:valid ~ .form-label {
    top: -0.65rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: var(--color-accent-teal);
    background-color: #1A1A2E; 
    padding: 0 0.25rem;
}
.custom-select-wrapper {
    position: relative;
}
.custom-select-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.5rem;
}
.custom-select-arrow {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    pointer-events: none;
    color: var(--color-text-muted);
}
@keyframes border-glow {
    0% { border-color: var(--color-accent-purple); box-shadow: 0 0 20px rgba(96, 81, 155, 0.5); }
    50% { border-color: var(--color-accent-teal); box-shadow: 0 0 30px rgba(0, 175, 185, 0.7); }
    100% { border-color: var(--color-accent-purple); box-shadow: 0 0 20px rgba(96, 81, 155, 0.5); }
}
.futuristic-modal {
     border: 2px solid;
     animation: border-glow 4s linear infinite;
}

/* Animated SVG Styles */
.animated-svg-container {
    border: 1px solid rgba(96, 81, 155, 0.5);
    border-radius: 0.5rem;
    padding: 2rem;
    background: rgba(26, 26, 46, 0.2);
    backdrop-filter: blur(5px);
}
.animated-svg .node {
    animation: pulse-node 4s infinite ease-in-out;
}
.animated-svg .line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw-line 6s infinite ease-in-out;
}
@keyframes pulse-node {
    0%, 100% { transform: scale(0.8); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
}
@keyframes draw-line {
    0% { stroke-dashoffset: 100; opacity: 0;}
    30% { stroke-dashoffset: 0; opacity: 1;}
    70% { stroke-dashoffset: 0; opacity: 1;}
    100% { stroke-dashoffset: -100; opacity: 0;}
}

/* Location Card Styles */
.location-card {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    animation: border-glow 6s infinite ease-in-out alternate;
}
.location-card-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0.15; /* Increased opacity */
    filter: blur(2px);
    pointer-events: none;
}
.location-card-bg .path-anim {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-path 15s infinite linear;
}
@keyframes draw-path {
    to { stroke-dashoffset: -1000; }
}
.location-card-content {
    position: relative;
    z-index: 1;
}

