@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --tw-color-primary: #166534;
    --dtp-emerald: #047857;
    --dtp-emerald-deep: #064e3b;
    --dtp-emerald-ink: #022c22;
    --dtp-emerald-glow: rgba(16, 185, 129, 0.35);
    --dtp-focus-ring: rgba(16, 185, 129, 0.6);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.font-display {
    font-family: 'Playfair Display', Georgia, serif;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 100;
    background: #022c22;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

*:focus {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--dtp-focus-ring);
    outline-offset: 3px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--dtp-focus-ring);
    outline-offset: 2px;
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(15deg); }
}
@keyframes float-medium {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-40px) rotate(-12deg); }
}
@keyframes float-fast {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(25deg); }
}
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes blob-morph {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}
@keyframes scroll-line {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}
@keyframes fade-rise {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.animate-float-slow { animation: float-slow 18s ease-in-out infinite; }
.animate-float-medium { animation: float-medium 14s ease-in-out infinite; }
.animate-float-fast { animation: float-fast 9s ease-in-out infinite; }
.animate-blob-morph { animation: blob-morph 12s ease-in-out infinite; }
.animate-fade-rise { animation: fade-rise 1s cubic-bezier(0.16, 1, 0.3, 1) both; }

#navbar {
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px -10px rgba(6, 78, 59, 0.15);
}

.nav-link {
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #10b981;
    transition: width 0.3s ease;
}

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

#home {
    background-attachment: fixed;
}

@media (max-width: 768px) {
    #home {
        background-attachment: scroll;
    }
}

.hero-text-shadow {
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

#mobile-menu {
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

footer {
    background-image: radial-gradient(circle at 25% 25%, rgba(16, 185, 129, 0.15) 1px, transparent 0);
    background-size: 60px 60px;
}

.octagon {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.octagon-feature {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
    transition: opacity 2s cubic-bezier(0.4, 0, 0.6, 1), transform 2s cubic-bezier(0.4, 0, 0.6, 1);
    will-change: transform, opacity;
}

.octagon-feature.in-view {
    opacity: 1 !important;
    transform: translate(0, 0) rotate(0deg) scale(1) !important;
    transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-enabled .octagon-feature {
    opacity: 0;
}

.js-enabled .octagon-feature[data-from="top-left"]     { transform: translate(-80vw, -40vh) rotate(-35deg) scale(0.4); }
.js-enabled .octagon-feature[data-from="top-right"]    { transform: translate(80vw, -40vh) rotate(35deg) scale(0.4); }
.js-enabled .octagon-feature[data-from="left"]         { transform: translate(-90vw, 0) rotate(-25deg) scale(0.5); }
.js-enabled .octagon-feature[data-from="right"]        { transform: translate(90vw, 0) rotate(25deg) scale(0.5); }
.js-enabled .octagon-feature[data-from="center"]       { transform: translate(0, 30vh) rotate(0deg) scale(0.4); }
.js-enabled .octagon-feature[data-from="bottom-left"]  { transform: translate(-60vw, 50vh) rotate(-20deg) scale(0.4); }
.js-enabled .octagon-feature[data-from="bottom-right"] { transform: translate(60vw, 50vh) rotate(20deg) scale(0.4); }

.octagon-card {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #064e3b;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow:
        0 20px 50px -12px rgba(6, 78, 59, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
}

.octagon-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.78) 0%, rgba(2, 44, 34, 0.88) 100%);
    transition: opacity 0.5s ease;
    z-index: 1;
}

.octagon-card:hover::before,
.octagon-card:focus-within::before {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.55) 0%, rgba(2, 44, 34, 0.7) 100%);
}

.octagon-card > * {
    position: relative;
    z-index: 2;
}

.octagon-card:hover,
.octagon-card:focus-within {
    transform: scale(1.08) rotate(-2deg);
    box-shadow:
        0 30px 70px -10px rgba(6, 78, 59, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.octagon-card .octagon-label {
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.octagon-card .octagon-sub {
    color: #d1fae5;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.octagon-card .octagon-icon {
    color: #fbbf24;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.parallax-plant {
    position: absolute;
    pointer-events: none;
    will-change: transform;
    transition: transform 0.1s linear;
    z-index: 1;
}

.scroll-reveal,
.scroll-reveal-left,
.scroll-reveal-right,
.scroll-reveal-scale {
    opacity: 1;
    transform: none;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.js-enabled .scroll-reveal { opacity: 0; transform: translateY(60px); }
.js-enabled .scroll-reveal-left { opacity: 0; transform: translateX(-80px); }
.js-enabled .scroll-reveal-right { opacity: 0; transform: translateX(80px); }
.js-enabled .scroll-reveal-scale { opacity: 0; transform: scale(0.9); }

.scroll-reveal.in-view,
.scroll-reveal-left.in-view,
.scroll-reveal-right.in-view,
.scroll-reveal-scale.in-view {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

.gradient-text {
    background: linear-gradient(135deg, #6ee7b7 0%, #a7f3d0 50%, #6ee7b7 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 6s ease infinite;
}

.gradient-text-on-light {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #047857 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 6s ease infinite;
}

.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.btn-shimmer:hover::after,
.btn-shimmer:focus-visible::after {
    left: 100%;
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.process-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease, background-color 0.4s ease;
}

.process-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.process-card:hover::before,
.process-card:focus-within::before {
    opacity: 1;
}

.process-card:hover,
.process-card:focus-within {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 30px 60px -15px rgba(16, 185, 129, 0.4);
}

.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.18), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.7s ease, height 0.7s ease;
    pointer-events: none;
}

.service-card:hover::before,
.service-card:focus-within::before {
    width: 600px;
    height: 600px;
}

.service-icon {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.service-card:hover .service-icon,
.service-card:focus-within .service-icon {
    transform: rotate(360deg) scale(1.15);
}

.project-card {
    position: relative;
    overflow: hidden;
}

.project-card img {
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover img,
.project-card:focus-within img {
    transform: scale(1.12);
}

.project-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.6) 45%, rgba(0, 0, 0, 0.15) 85%, transparent 100%);
}

.testimonial-card {
    position: relative;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -20px;
    right: 20px;
    font-family: Georgia, serif;
    font-size: 7rem;
    color: rgba(16, 185, 129, 0.12);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.testimonial-card:hover,
.testimonial-card:focus-within {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px -15px rgba(6, 78, 59, 0.25);
}

.stat-counter {
    display: inline-block;
}

.scroll-indicator {
    position: relative;
    width: 2px;
    height: 60px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
    border-radius: 2px;
}

.scroll-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: white;
    border-radius: 2px;
    animation: scroll-line 2.5s ease-in-out infinite;
}

.honeycomb {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    aspect-ratio: 6 / 5;
}

.honeycomb-cell {
    position: absolute;
    width: 27%;
    aspect-ratio: 0.866 / 1;
}

.honeycomb-cell[data-pos="top-1"]    { top: 1%;     left: 22%;   }
.honeycomb-cell[data-pos="top-2"]    { top: 1%;     left: 51%;   }

.honeycomb-cell[data-pos="mid-1"]    { top: 31%;    left: 7.5%;  }
.honeycomb-cell[data-pos="mid-2"]    { top: 31%;    left: 36.5%; }
.honeycomb-cell[data-pos="mid-3"]    { top: 31%;    left: 65.5%; }

.honeycomb-cell[data-pos="bot-1"]    { top: 61%;    left: 22%;   }
.honeycomb-cell[data-pos="bot-2"]    { top: 61%;    left: 51%;   }

@media (max-width: 640px) {
    .honeycomb {
        max-width: 420px;
        aspect-ratio: 1 / 2.1;
    }

    .honeycomb-cell {
        width: 43%;
    }

    .honeycomb-cell[data-pos="top-1"]    { top: 1%;     left: 28.5%; }
    .honeycomb-cell[data-pos="top-2"]    { top: 19%;    left: 6%;    }
    .honeycomb-cell[data-pos="mid-1"]    { top: 19%;    left: 51%;   }
    .honeycomb-cell[data-pos="mid-2"]    { top: 37%;    left: 28.5%; }
    .honeycomb-cell[data-pos="mid-3"]    { top: 55%;    left: 6%;    }
    .honeycomb-cell[data-pos="bot-1"]    { top: 55%;    left: 51%;   }
    .honeycomb-cell[data-pos="bot-2"]    { top: 73%;    left: 28.5%; }
}

.bg-leaf-pattern {
    background-image:
        radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(132, 204, 22, 0.04) 0%, transparent 50%);
}

.marquee-container {
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.marquee-track {
    display: flex;
    gap: 3rem;
    animation: marquee 35s linear infinite;
    white-space: nowrap;
    width: max-content;
}

.marquee-container:hover .marquee-track,
.marquee-container:focus-within .marquee-track {
    animation-play-state: paused;
}

.cursor-light {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 1;
    mix-blend-mode: screen;
    will-change: transform;
}

@media (max-width: 1024px) {
    .cursor-light {
        display: none;
    }
}

.contact-page-body {
    background: #022c22;
    min-height: 100vh;
}

.contact-bg-image {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 0;
}

.contact-bg-overlay {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(2, 44, 34, 0.85) 0%, rgba(4, 47, 46, 0.92) 100%),
        radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.15), transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(132, 204, 22, 0.1), transparent 60%);
    z-index: 1;
}

@media (max-width: 768px) {
    .contact-bg-image {
        background-attachment: scroll;
    }
}

.contact-form-card {
    position: relative;
    z-index: 10;
    background: #ffffff;
    box-shadow:
        0 50px 100px -20px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #022c22;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    border-radius: 1rem;
    border: 1.5px solid #d1d5db;
    padding: 0.875rem 1.25rem;
    color: #022c22;
    background: #ffffff;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    outline: none;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:hover:not(:focus) {
    border-color: #10b981;
}

.form-input:focus,
.form-input:focus-visible {
    border-color: #047857;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    outline: none;
    background: #f0fdf4;
}

.form-input:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #ef4444;
}

.required-star {
    color: #dc2626;
    margin-left: 4px;
    font-weight: 700;
    font-size: 1em;
    line-height: 1;
}

.form-helper {
    font-size: 0.8125rem;
    color: #047857;
    margin-top: 0.375rem;
}

select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23047857' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.75rem;
    cursor: pointer;
}

textarea.form-input {
    min-height: 8rem;
    resize: vertical;
}

.success-card {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1.5px solid #10b981;
    color: #022c22;
}

.error-banner {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    color: #991b1b;
}

@media (max-width: 640px) {
    a[href="/quote"] {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        font-size: 0.875rem !important;
        line-height: 1.25rem !important;
        white-space: nowrap !important;
    }

    .hero-title {
        font-size: 2.75rem !important;
        line-height: 1.05 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    html {
        scroll-behavior: auto;
    }

    .js-enabled .octagon-feature,
    .js-enabled .scroll-reveal,
    .js-enabled .scroll-reveal-left,
    .js-enabled .scroll-reveal-right,
    .js-enabled .scroll-reveal-scale {
        opacity: 1 !important;
        transform: none !important;
    }

    .marquee-track {
        animation: none !important;
    }

    .cursor-light {
        display: none !important;
    }

    .parallax-plant {
        transform: none !important;
    }

    .gradient-text,
    .gradient-text-on-light {
        animation: none !important;
        background-position: 0% 50%;
    }
}

@media (prefers-contrast: more) {
    .form-input {
        border-width: 2px;
        border-color: #022c22;
    }

    .form-label {
        color: #000000;
    }

    .nav-link::after {
        background: #022c22;
    }
}