/* ============================================
   3D TYPOGRAPHY ANIMATIONS
   ============================================ */

/* === ANIMATED TEXT EFFECTS === */

/* 3D Text Pop-In */
@keyframes text-pop-3d {
    0% {
        opacity: 0;
        transform: scale(0.8) translateZ(-50px) rotateX(-20deg);
    }

    50% {
        transform: scale(1.05) translateZ(20px) rotateX(5deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateZ(0) rotateX(0);
    }
}

/* 3D Text Slide Up */
@keyframes text-slide-up-3d {
    0% {
        opacity: 0;
        transform: translateY(50px) translateZ(-30px) rotateX(-15deg);
    }

    100% {
        opacity: 1;
        transform: translateY(0) translateZ(0) rotateX(0);
    }
}

/* 3D Text Rotate In */
@keyframes text-rotate-in-3d {
    0% {
        opacity: 0;
        transform: rotateY(-90deg) translateZ(-50px);
    }

    100% {
        opacity: 1;
        transform: rotateY(0) translateZ(0);
    }
}

/* Letter Spacing Animation */
@keyframes letter-spacing-expand {
    0% {
        letter-spacing: -0.05em;
        opacity: 0;
    }

    100% {
        letter-spacing: 0.02em;
        opacity: 1;
    }
}

/* Glowing Text Effect */
@keyframes text-glow {

    0%,
    100% {
        text-shadow:
            0 0 10px rgba(212, 175, 55, 0.3),
            0 0 20px rgba(212, 175, 55, 0.2),
            0 2px 20px rgba(0, 0, 0, 0.3);
    }

    50% {
        text-shadow:
            0 0 20px rgba(212, 175, 55, 0.6),
            0 0 40px rgba(212, 175, 55, 0.4),
            0 2px 30px rgba(0, 0, 0, 0.4);
    }
}

/* === TYPOGRAPHY CLASSES === */

/* Hero Title - Dramatic 3D Entry */
.hero-title {
    animation: text-pop-3d 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.hero-title .text-gold {
    display: inline-block;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

/* Section Titles - 3D Slide Up */
.section-title {
    animation: text-slide-up-3d 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-style: preserve-3d;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Animated Underline for Titles */
.section-title::after {
    content: '';
    display: block;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brushed-gold), transparent);
    margin: var(--spacing-sm) auto 0;
    animation: underline-expand 1s ease-out 0.5s forwards;
}

@keyframes underline-expand {
    to {
        width: 80px;
    }
}

/* Subtitle Animations */
.section-subtitle,
.hero-subtitle {
    animation: letter-spacing-expand 1s ease-out 0.3s forwards;
    opacity: 0;
}

/* Pillar Titles - Rotate In */
.pillar-title {
    animation: text-rotate-in-3d 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* Cabinet Title - Enhanced */
.cabinet-title {
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Area County Names - Bold Impact */
.area-county {
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* === ENHANCED TEXT SHADOWS === */

/* Premium Text Shadow for Headings */
h1,
h2,
h3 {
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.06);
}

/* Gold Text Enhancement */
.text-gold {
    background: linear-gradient(135deg, #e6c968 0%, #d4af37 50%, #b8941f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    position: relative;
    text-shadow: none;
    display: inline-block;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

/* 3D Depth Effect for Large Text */
.hero-title,
.section-title {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === WORD ANIMATION STAGGER === */

/* Individual word animations */
.word-animate {
    display: inline-block;
    opacity: 0;
    animation: word-fade-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes word-fade-in {
    0% {
        opacity: 0;
        transform: translateY(20px) rotateX(-10deg);
    }

    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.word-animate:nth-child(1) {
    animation-delay: 0.1s;
}

.word-animate:nth-child(2) {
    animation-delay: 0.2s;
}

.word-animate:nth-child(3) {
    animation-delay: 0.3s;
}

.word-animate:nth-child(4) {
    animation-delay: 0.4s;
}

.word-animate:nth-child(5) {
    animation-delay: 0.5s;
}

/* === HOVER EFFECTS === */

/* Interactive Title Hover */
.pillar-title:hover,
.cabinet-title:hover {
    transform: translateZ(10px);
    transition: transform 0.3s ease;
}

/* === RESPONSIVE TYPOGRAPHY === */

@media (max-width: 768px) {

    /* Simplify animations on mobile */
    .hero-title,
    .section-title,
    .pillar-title {
        animation-duration: 0.6s;
    }

    /* Reduce text shadows on mobile */
    h1,
    h2,
    h3 {
        text-shadow:
            0 2px 4px rgba(0, 0, 0, 0.2),
            0 4px 8px rgba(0, 0, 0, 0.15);
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {

    .hero-title,
    .section-title,
    .pillar-title,
    .section-subtitle,
    .hero-subtitle,
    .word-animate {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .text-gold {
        animation: none;
    }
}

/* === PROFESSIONAL TYPOGRAPHY ENHANCEMENTS === */

/* Improved Readability */
p {
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.01em;
}

/* Strong Emphasis */
strong {
    font-weight: 700;
    color: var(--white);
}

/* Button Text */
.btn {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Navigation Links */
.nav-link {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Footer Text */
.footer {
    font-family: var(--font-body);
}

.footer h3,
.footer h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.02em;
}