:root {
    /* Colors */
    --clr-bg: #0a0a0a;
    --clr-bg-surface: #121212;
    --clr-bg-card: rgba(25, 25, 25, 0.6);
    --clr-gold: #C9A84C;
    --clr-gold-light: #DEBE64;
    --clr-gold-glow: rgba(201, 168, 76, 0.4);
    --clr-text-main: #ffffff;
    --clr-text-sec: #E6E1D3; /* Warm cream */
    --clr-text-muted: #a0a0a0;

    /* Typography */
    --font-display: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Animations & Timing */
    --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
    --duration-fast: 400ms;
    --duration-med: 600ms;
    --duration-slow: 900ms;
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--clr-bg);
    color: var(--clr-text-sec);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
    font-family: var(--font-display);
    color: var(--clr-text-main);
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

a {
    text-decoration: none;
    color: inherit;
}

.text-gold {
    color: var(--clr-gold);
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Hero Section Base */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto; /* Allow mouse tracking */
}

/* Utilities */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all var(--duration-fast) var(--ease-premium);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.btn-primary {
    background-color: var(--clr-gold);
    color: var(--clr-bg);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    transition: none;
}

.btn-primary:hover::after {
    animation: shimmerSweep 0.8s var(--ease-out) forwards;
}

@keyframes shimmerSweep {
    100% { left: 150%; }
}

.btn-outline {
    background-color: transparent;
    color: var(--clr-gold);
    border: 1px solid var(--clr-gold);
}

.btn-outline:hover {
    background-color: rgba(201, 168, 76, 0.1);
    box-shadow: 0 0 15px var(--clr-gold-glow);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    position: relative;
    z-index: 10;
}

.h4z-logo-text {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--clr-text-main);
    letter-spacing: 0.1em;
    line-height: 1;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(10px);
}

body.loaded .h4z-logo-text {
    animation: fadeUp 1s var(--ease-premium) forwards;
}

.nav-links {
    display: none;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-item {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    color: var(--clr-text-sec);
    transition: color var(--duration-fast);
}

.nav-item:hover {
    color: var(--clr-gold);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--clr-gold);
    transition: width var(--duration-fast) var(--ease-out);
}

.nav-item:hover::after {
    width: 100%;
}

/* Hero Content */
.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 0 8rem;
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.hero-headline {
    font-size: clamp(3.5rem, 8vw, 7rem);
    display: flex;
    flex-wrap: wrap;
    gap: 0.2em;
    margin-bottom: 1.5rem;
}

.text-glow {
    text-shadow: 0 0 15px rgba(201, 168, 76, 0.4), 0 0 30px rgba(201, 168, 76, 0.2);
    animation: textPulse 4s infinite alternate var(--ease-premium);
}

.text-gradient {
    background: linear-gradient(135deg, var(--clr-gold-light), var(--clr-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

@keyframes textPulse {
    0% { text-shadow: 0 0 10px rgba(201, 168, 76, 0.3); }
    100% { text-shadow: 0 0 25px rgba(201, 168, 76, 0.6), 0 0 40px rgba(201, 168, 76, 0.3); }
}

.stagger-line {
    opacity: 0;
    transform: translateY(30px);
}

body.loaded .stagger-line {
    animation: fadeUp var(--duration-slow) var(--ease-premium) forwards;
}

body.loaded .hero-headline .stagger-line:nth-child(1) { animation-delay: 0.6s; }
body.loaded .hero-headline .stagger-line:nth-child(2) { animation-delay: 0.8s; }
body.loaded .hero-headline .stagger-line:nth-child(3) { animation-delay: 1.0s; }

.hero-subhead {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: var(--clr-text-sec);
    max-width: 600px;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
}

body.loaded .hero-subhead {
    animation-delay: 1.2s;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(20px);
}

body.loaded .hero-cta-group {
    animation: fadeUp var(--duration-slow) var(--ease-premium) forwards;
    animation-delay: 1.4s;
}

/* Infinite Marquee */
.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    background: var(--clr-bg-surface);
    border-top: 1px solid rgba(201, 168, 76, 0.2);
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
    padding: 1rem 0;
    white-space: nowrap;
    position: relative;
    z-index: 20;
}

.marquee-content {
    display: inline-flex;
    align-items: center;
    gap: 2rem;
    animation: scrollMarquee 25s linear infinite;
}

.marquee-item {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 2rem;
}

.marquee-dot {
    color: var(--clr-gold);
    margin-right: 2rem;
}

@keyframes scrollMarquee {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-50% - 1rem)); } /* -50% because we duplicated the content array */
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections Base */
.section {
    padding: 8rem 0;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.bg-surface {
    background-color: var(--clr-bg-surface);
}

.relative { position: relative; }
.z-10 { z-index: 10; }

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 4rem;
    position: relative;
    display: inline-block;
}

/* Section Header Wipe Animation */
.reveal-fade {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s var(--ease-premium);
}

.reveal-fade.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scroll Reveal Utilities */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s var(--ease-premium);
}

.reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
    /* if stagger variable is provided, delay it */
    transition-delay: calc(var(--stagger, 0) * 0.15s);
}

/* Services Grid */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.card {
    flex: 1 1 300px;
    max-width: 380px;
    background: rgba(25, 25, 25, 0.5); /* More transparent for glassmorphism */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.03);
    padding: 3rem 2rem;
    border-radius: 12px;
    transition: transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Conic Gradient Animated Border Wrapper Trick */
.card::before {
    content: '';
    position: absolute;
    inset: -2px; /* slightly larger than card */
    background: conic-gradient(from var(--gradient-angle), transparent 70%, var(--clr-gold) 100%);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--duration-fast);
    animation: spinGradient 4s linear infinite;
}

.card::after {
    content: '';
    position: absolute;
    inset: 1px; /* 1px inner border leaves the gradient showing */
    background: var(--clr-bg-surface); /* Solid background to hide gradient center */
    border-radius: inherit;
    z-index: -1;
}

@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes spinGradient {
    0% { --gradient-angle: 0deg; }
    100% { --gradient-angle: 360deg; }
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px -10px var(--clr-gold-glow);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 48px;
    height: 48px;
    color: var(--clr-gold);
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}

.card-desc {
    color: var(--clr-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 0; /* Moved to step */
}

@media (min-width: 768px) {
    .timeline {
        padding-left: 0;
    }
}

.timeline-line {
    position: absolute;
    left: 1.5rem; /* Anchor to exact left offeset */
    margin-left: -1px;
    transform: none;
    top: 2rem;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
    .timeline-line {
        left: 50%;
        transform: translateX(-50%);
    }
}

.timeline-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--clr-gold);
    transition: height 1.5s var(--ease-premium);
}

.timeline.is-visible .timeline-line-progress {
    height: 100%;
}

.timeline-step {
    position: relative;
    margin-bottom: 4rem;
    width: 100%;
    padding-left: 4.5rem; /* Content spacing */
}

@media (min-width: 768px) {
    .timeline-step {
        width: 50%;
        padding-right: 3rem;
        padding-left: 0; /* Reset for desktop */
        text-align: right;
    }
    
    .timeline-step:nth-child(odd) {
        margin-left: auto;
        padding-right: 0;
        padding-left: 3rem; /* Desktop left spacer */
        text-align: left;
    }
}

.step-marker {
    position: absolute;
    left: 0; /* Matches line center exactly (both sum to 1.5rem absolute offset from parent edge) */
    top: 0;
    transform: none;
    width: 3rem;
    height: 3rem;
    background: var(--clr-bg-surface);
    border: 2px solid var(--clr-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    color: var(--clr-gold);
    font-size: 1.25rem;
    font-weight: 700;
    z-index: 2;
    transition: all var(--duration-med) var(--ease-premium);
    box-shadow: 0 0 0 0 var(--clr-gold-glow);
}

@media (min-width: 768px) {
    .step-marker {
        left: 100%;
        transform: translateX(-50%);
    }
    .timeline-step:nth-child(odd) .step-marker {
        left: 0;
        transform: translateX(-50%);
    }
}

.timeline-step.is-visible .step-marker {
    box-shadow: 0 0 20px 5px var(--clr-gold-glow);
    background: var(--clr-gold);
    color: var(--clr-bg);
}

.step-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
}

.step-desc {
    color: var(--clr-text-muted);
}

/* Stats / Why H4Z */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-card {
    padding: 3rem 1rem;
    background: rgba(25, 25, 25, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px dashed rgba(201, 168, 76, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.stat-card:hover {
    background: rgba(201, 168, 76, 0.05);
    border: 1px solid var(--clr-gold);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.stat-label {
    font-size: 1.125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--clr-text-sec);
}

/* Testimonials */
.testimonials-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.testimonial-card {
    background: var(--clr-bg-card);
    padding: 3rem 4rem;
    border-radius: 8px;
    position: relative;
    border-left: 2px solid var(--clr-gold);
}

@media (min-width: 768px) {
    .testimonial-card:nth-child(even) {
        margin-left: 4rem;
        border-left: none;
        border-right: 2px solid var(--clr-gold);
    }
    
    .testimonial-card:nth-child(odd) {
        margin-right: 4rem;
    }
}

.quote-mark {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-family: var(--font-display);
    font-size: 6rem;
    line-height: 1;
    color: var(--clr-gold-glow);
    opacity: 0.3;
}

.testimonial-card:nth-child(even) .quote-mark {
    left: auto;
    right: 1.5rem;
}

.quote-text {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--clr-text-main);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.quote-author {
    color: var(--clr-gold);
    font-weight: 500;
    font-family: var(--font-display);
    letter-spacing: 0.05em;
}

/* Slide in Animations */
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s var(--ease-premium);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s var(--ease-premium);
}

.slide-in-left.is-visible,
.slide-in-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Utilities */
.text-center { text-align: center; }

/* Apply Form Section */
.apply-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--clr-bg-surface);
    padding: 3.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.apply-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.form-group {
    position: relative;
    width: 100%;
}

.form-input {
    width: 100%;
    padding: 1rem 0;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--clr-text-main);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    outline: none;
    transition: border-color var(--duration-fast);
}

.form-label {
    position: absolute;
    top: 1rem;
    left: 0;
    color: var(--clr-text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s var(--ease-out);
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--clr-gold);
    transition: width 0.4s var(--ease-premium);
}

.form-input:focus ~ .input-line,
.form-input:not(:placeholder-shown) ~ .input-line {
    width: 100%;
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    top: -12px;
    font-size: 0.75rem;
    color: var(--clr-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-submit {
    width: 100%;
    margin-top: 1rem;
    animation: pulseGlow 4s infinite var(--ease-premium);
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 var(--clr-gold-glow); }
    50% { box-shadow: 0 0 20px 2px var(--clr-gold-glow); }
}

/* Footer */
.footer {
    border-top: 1px solid var(--clr-gold);
    background-color: var(--clr-bg);
    padding: 5rem 0 2rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
    justify-content: space-between;
    margin-bottom: 4rem;
}

.footer-brand {
    max-width: 320px;
}

.footer-desc {
    margin-top: 1.5rem;
    color: var(--clr-text-muted);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: var(--clr-text-sec);
    text-transform: uppercase;
    font-family: var(--font-display);
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--clr-gold);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--clr-text-muted);
}

.footer-email {
    color: var(--clr-gold);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.social-link {
    color: var(--clr-text-sec);
    text-transform: uppercase;
    font-family: var(--font-display);
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.social-link:hover {
    color: var(--clr-gold);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    color: var(--clr-text-muted);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 3rem;
    }
}
