/* ============================================
   Forever Welding — Custom Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f3ee;
}
::-webkit-scrollbar-thumb {
    background: #2d6a4f;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #1b4332;
}

/* --- Selection --- */
::selection {
    background: #2d6a4f;
    color: #faf9f6;
}

/* --- Focus --- */
:focus-visible {
    outline: 2px solid #2d6a4f;
    outline-offset: 2px;
}

/* --- Header --- */
.site-header {
    background: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

.site-header.scrolled {
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(27, 67, 50, 0.08);
}

/* Nav links — light when on hero (dark bg), dark when scrolled (light bg) */
.nav-link {
    color: rgba(250, 249, 246, 0.85);
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

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

.site-header.scrolled .nav-link {
    color: #3d3328;
}

.site-header.scrolled .nav-link:hover {
    color: #1b4332;
}

.nav-cta {
    color: rgba(250, 249, 246, 0.9) !important;
    border: 1px solid rgba(250, 249, 246, 0.3);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

.nav-cta:hover {
    background: rgba(250, 249, 246, 0.15);
    border-color: rgba(250, 249, 246, 0.6);
}

.site-header.scrolled .nav-cta {
    color: #1b4332 !important;
    border-color: #1b4332;
}

.site-header.scrolled .nav-cta:hover {
    background: #1b4332;
    color: #faf9f6 !important;
}

/* Logo colors */
.nav-logo-text { color: rgba(250, 249, 246, 0.95); }
.nav-subtitle-text { color: rgba(250, 249, 246, 0.6); }
.site-header.scrolled .nav-logo-text { color: #1b4332; }
.site-header.scrolled .nav-subtitle-text { color: #8a7560; }
.nav-logo-ring { stroke: rgba(250, 249, 246, 0.9); }
.nav-logo-spark { fill: rgba(250, 249, 246, 0.9); }
.nav-logo-core { fill: rgba(250, 249, 246, 0.9); }
.site-header.scrolled .nav-logo-ring { stroke: #1b4332; }
.site-header.scrolled .nav-logo-spark { fill: #1b4332; }
.site-header.scrolled .nav-logo-core { fill: #1b4332; }

/* --- Mobile Menu --- */
.mobile-nav-link {
    transition: color 0.3s ease, transform 0.3s ease;
}

.mobile-nav-link:hover {
    color: #2d6a4f;
    transform: translateX(4px);
}

#mobile-menu.menu-open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.menu-closed {
    opacity: 0;
    pointer-events: none;
}

/* --- Hero --- */
.hero {
    position: relative;
}

.hero-bg {
    will-change: transform;
}

.hero-overlay {
    background: rgba(7, 21, 16, 0.45);
}

.hero-gradient {
    /* Additional gradient overlay for text readability */
}

.hero-headline {
    line-height: 1.1;
}

/* Scroll indicator animation */
@keyframes scroll-indicator {
    0% { opacity: 0; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(8px); }
    100% { opacity: 0; transform: translateY(16px); }
}

.animate-scroll-indicator {
    animation: scroll-indicator 2s ease-in-out infinite;
}

/* --- Section Styles --- */
.section {
    position: relative;
}

.section-eyebrow {
    display: block;
}

.section-divider {
    color: #b9d0b8;
}

.section-divider-line {
    stroke: #b9d0b8;
}

.section-divider-line-light {
    stroke: rgba(250, 249, 246, 0.4);
}

/* --- Service Cards --- */
.service-card-inner {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.5s ease, transform 0.5s ease;
}

.service-card-inner:hover {
    box-shadow: 0 20px 60px rgba(27, 67, 50, 0.12);
}

.service-card-icon {
    color: #2d6a4f;
}

.service-card-title {
    letter-spacing: -0.01em;
}

.service-card-text {
    line-height: 1.7;
}

/* --- About --- */
.about-image-wrapper {
    position: relative;
}

.about-value-icon {
    color: #8fb88f;
}

/* --- Gallery --- */
.gallery-item-inner {
    aspect-ratio: auto;
    overflow: hidden;
}

.gallery-item:nth-child(1) .gallery-item-inner,
.gallery-item:nth-child(5) .gallery-item-inner {
    aspect-ratio: 1 / 1;
}

.gallery-item:nth-child(2) .gallery-item-inner,
.gallery-item:nth-child(3) .gallery-item-inner,
.gallery-item:nth-child(4) .gallery-item-inner,
.gallery-item:nth-child(6) .gallery-item-inner {
    aspect-ratio: 3 / 2;
}

.gallery-img {
    display: block;
}

/* --- Testimonials --- */
.testimonial-card-inner {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.testimonial-card-inner:hover {
    box-shadow: 0 12px 40px rgba(27, 67, 50, 0.1);
    transform: translateY(-2px);
}

.testimonial-quote-icon {
    opacity: 0.6;
}

.testimonial-text {
    font-size: 1rem;
    line-height: 1.8;
}

/* --- CTA Banner --- */
.cta-btn-primary {
    font-weight: 600;
}

.cta-btn-secondary {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* --- Contact Form --- */
.form-label {
    letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
    font-size: 0.9375rem;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #c8b9a6;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.form-submit {
    letter-spacing: 0.12em;
}

.form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(27, 67, 50, 0.25);
}

.form-submit:active {
    transform: translateY(0);
}

.form-success {
    animation: fadeInUp 0.4s ease forwards;
}

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

/* --- Footer --- */
.footer {
    position: relative;
}

.footer-logo-ring { stroke: rgba(250, 249, 246, 0.8); }
.footer-logo-spark { fill: rgba(250, 249, 246, 0.8); }
.footer-logo-core { fill: rgba(250, 249, 246, 0.8); }

.footer-link {
    display: inline-flex;
    align-items: center;
}

.footer-link:hover {
    text-decoration: none;
}

.footer-bottom {
    border-color: rgba(250, 249, 246, 0.08);
}

/* --- Back to Top --- */
.back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.back-to-top:not(.visible) {
    transform: translateY(8px);
}

.back-to-top:hover {
    transform: translateY(-2px) !important;
}

/* --- Reveal Animations --- */
/* Default: all elements visible (no JS required) */
[data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
}

/* When JS is enabled and user prefers motion, add animations */
.js-enabled [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js-enabled [data-reveal].revealed {
    opacity: 1;
    transform: none;
}

/* Stagger children */
.js-enabled .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js-enabled .reveal.revealed {
    opacity: 1;
    transform: none;
}

/* Hero reveals are handled separately */
.js-enabled .hero-eyebrow { transition-delay: 0.1s; }
.js-enabled .hero-divider { transition-delay: 0.2s; }
.js-enabled .hero-headline { transition-delay: 0.3s; }
.js-enabled .hero-subtitle { transition-delay: 0.4s; }
.js-enabled .hero-actions { transition-delay: 0.5s; }
.js-enabled .hero-scroll { transition-delay: 0.7s; }

/* Reduced motion: keep everything visible */
@media (prefers-reduced-motion: reduce) {
    [data-reveal],
    .reveal,
    .animate-scroll-indicator {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
}

/* --- Responsive --- */
@media (max-width: 767px) {
    .hero-headline {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .about-image-badge {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        margin-top: 1rem;
    }

    .about-image-accent {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-headline {
        font-size: 3.5rem;
    }
}

@media (min-width: 1024px) {
    .hero-headline {
        font-size: 4.5rem;
    }
}
