/*
 * Redshaw Advisors — Premium Enhancements
 * 10X Quality of Life Improvements
 * Advanced animations, polish, and accessibility
 */

/* ========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */

:root {
    /* Timing Functions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
    
    /* Durations */
    --duration-fast: 0.2s;
    --duration-medium: 0.4s;
    --duration-slow: 0.8s;
    
    /* Shadows */
    --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 8px 40px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 30px rgba(255, 255, 255, 0.1);
    
    /* Colors */
    --accent-glow: rgba(100, 200, 255, 0.3);
    --success-color: #4ade80;
    --error-color: #f87171;
}

/* ========================================
   GLOBAL ANIMATION UTILITIES
   ======================================== */

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Scale Animation */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Pulse Glow */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 20px 5px var(--accent-glow); }
}

/* Float Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Counter Animation Helper */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typing Cursor */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ========================================
   SCROLL PROGRESS INDICATOR
   ======================================== */

.scroll-progress {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity var(--duration-medium) var(--ease-out-expo);
}

body:not(.is-preload) .scroll-progress {
    opacity: 1;
}

.scroll-progress .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out-expo);
    position: relative;
}

.scroll-progress .dot::before {
    content: attr(data-label);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    white-space: nowrap;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: all var(--duration-fast) var(--ease-out-expo);
}

.scroll-progress .dot:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.scroll-progress .dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.3);
}

.scroll-progress .dot.active {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ========================================
   ENHANCED PANEL TRANSITIONS
   ======================================== */

.panel .content,
.panel .intro,
.panel .inner {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--duration-slow) var(--ease-out-expo),
                transform var(--duration-slow) var(--ease-out-expo);
}

.panel.in-view .content,
.panel.in-view .intro,
.panel.in-view .inner {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Children Animation */
.panel.in-view .inner > * {
    animation: fadeInUp var(--duration-medium) var(--ease-out-expo) forwards;
}

.panel.in-view .inner > *:nth-child(1) { animation-delay: 0.1s; }
.panel.in-view .inner > *:nth-child(2) { animation-delay: 0.2s; }
.panel.in-view .inner > *:nth-child(3) { animation-delay: 0.3s; }
.panel.in-view .inner > *:nth-child(4) { animation-delay: 0.4s; }

/* ========================================
   HERO SECTION ENHANCEMENTS
   ======================================== */

#hero h1.major {
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

#hero .content {
    position: relative;
}

/* Animated Arrow Icon */
#hero .button.circle .icon::before {
    transition: transform var(--duration-fast) var(--ease-out-back);
}

#hero .button.circle:hover .icon::before {
    transform: translateX(3px);
}

/* ========================================
   BLOCKQUOTE STYLING (TESTIMONIALS)
   ======================================== */

blockquote {
    font-style: italic;
    font-size: 1.35rem;
    line-height: 1.7;
    position: relative;
    padding: 1.5rem 2rem;
    margin: 0 0 1.5rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid currentColor;
}

blockquote::before {
    content: '"';
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-size: 4rem;
    opacity: 0.15;
    font-family: Georgia, serif;
    line-height: 1;
}

blockquote p {
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* ========================================
   STATS SECTION — ANIMATED COUNTERS
   ======================================== */

.panel.color2-alt .inner.columns {
    perspective: 1000px;
}

.panel.color2-alt .inner.columns .span-2-5 {
    text-align: center;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--duration-medium) var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.panel.color2-alt .inner.columns .span-2-5::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    opacity: 0;
    transition: opacity var(--duration-medium);
}

.panel.color2-alt .inner.columns .span-2-5:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-medium);
}

.panel.color2-alt .inner.columns .span-2-5:hover::before {
    opacity: 1;
}

.panel.color2-alt .inner.columns .span-2-5 h3.major {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.panel.color2-alt .inner.columns .span-2-5 p {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.7;
    margin: 0;
}

/* ========================================
   SERVICES GRID ICONS ENHANCEMENT
   ======================================== */

.grid-icons li {
    transition: transform var(--duration-medium) var(--ease-out-expo);
}

.grid-icons li:hover {
    transform: scale(1.1);
}

.grid-icons li .icon {
    transition: all var(--duration-medium) var(--ease-out-expo);
}

.grid-icons li:hover .icon {
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.grid-icons.connected li::before,
.grid-icons.connected li::after {
    transition: background var(--duration-medium);
}

/* ========================================
   CASE STUDIES LIST STYLING
   ======================================== */

.panel ul.alt li {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--duration-fast) var(--ease-out-expo);
    cursor: default;
    position: relative;
    padding-left: 0;
}

.panel ul.alt li::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width var(--duration-fast) var(--ease-out-expo);
    transform: translateY(-50%);
}

.panel ul.alt li:hover {
    padding-left: 1.5rem;
}

.panel ul.alt li:hover::before {
    width: 1rem;
}

.panel ul.alt li:last-child {
    border-bottom: none;
}

.panel ul.alt li strong {
    display: inline-block;
    min-width: 140px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* ========================================
   ALL BUTTONS ENHANCEMENT
   ======================================== */

.button {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-fast) var(--ease-out-expo) !important;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--duration-slow) var(--ease-out-expo);
}

.button:hover::before {
    left: 100%;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.button:active {
    transform: translateY(0);
}

.button.primary {
    position: relative;
}

.button.primary:hover {
    box-shadow: var(--shadow-strong), 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Circle Button Enhancement */
.button.circle {
    transition: all var(--duration-fast) var(--ease-out-back) !important;
}

.button.circle:hover {
    transform: translateY(-3px) scale(1.05);
}

/* ========================================
   CONTACT FORM — PREMIUM STYLING
   ======================================== */

.panel.color4-alt form .field {
    position: relative;
}

.panel.color4-alt form label {
    transition: all var(--duration-fast) var(--ease-out-expo);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.panel.color4-alt form input,
.panel.color4-alt form textarea {
    transition: all var(--duration-fast) var(--ease-out-expo);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.panel.color4-alt form input:hover,
.panel.color4-alt form textarea:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.panel.color4-alt form input:focus,
.panel.color4-alt form textarea:focus {
    border-color: rgba(255, 255, 255, 0.5) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1), var(--shadow-glow);
    outline: none;
}

.panel.color4-alt form input::placeholder,
.panel.color4-alt form textarea::placeholder {
    opacity: 0.4;
    transition: opacity var(--duration-fast);
}

.panel.color4-alt form input:focus::placeholder,
.panel.color4-alt form textarea:focus::placeholder {
    opacity: 0.6;
}

/* Form Validation States */
.panel.color4-alt form input:valid:not(:placeholder-shown) {
    border-color: var(--success-color) !important;
}

.panel.color4-alt form input:invalid:not(:placeholder-shown):not(:focus) {
    border-color: var(--error-color) !important;
}

/* ========================================
   CONTACT ICONS ENHANCEMENT
   ======================================== */

.contact-icons li {
    transition: all var(--duration-fast) var(--ease-out-expo);
}

.contact-icons li:hover {
    transform: translateX(5px);
}

.contact-icons li a {
    position: relative;
    display: inline-block;
}

.contact-icons li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width var(--duration-fast) var(--ease-out-expo);
}

.contact-icons li a:hover::after {
    width: 100%;
}

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

.panel .image.filtered img {
    transition: transform var(--duration-slow) var(--ease-out-expo);
}

.panel:hover .image.filtered img {
    transform: scale(1.02);
}

/* ========================================
   KEYBOARD NAVIGATION FOCUS STYLES
   ======================================== */

:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
}

.button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
    box-shadow: var(--shadow-strong);
}

/* Skip Link for Accessibility */
.skip-link {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #000;
    padding: 1rem 2rem;
    z-index: 10000;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    transition: top var(--duration-fast);
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   REDUCED MOTION — ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-progress {
        display: none;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .scroll-progress,
    .button,
    form {
        display: none !important;
    }
    
    .panel {
        page-break-inside: avoid;
    }
    
    .panel .content,
    .panel .intro,
    .panel .inner {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ========================================
   RESPONSIVE ENHANCEMENTS
   ======================================== */

@media screen and (max-width: 1280px) {
    .scroll-progress {
        bottom: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .scroll-progress .dot {
        width: 8px;
        height: 8px;
    }
}

@media screen and (max-width: 980px) {
    .panel.color2-alt .inner.columns .span-2-5 h3.major {
        font-size: 2.5rem;
    }
}

@media screen and (max-width: 736px) {
    blockquote {
        font-size: 1.1rem;
        padding: 1rem 1.25rem;
    }
    
    blockquote::before {
        font-size: 2.5rem;
        top: 0;
    }
    
    .panel.color2-alt .inner.columns .span-2-5 {
        padding: 1.25rem 1rem;
    }
    
    .panel.color2-alt .inner.columns .span-2-5 h3.major {
        font-size: 2rem;
    }
    
    .panel ul.alt li strong {
        display: block;
        min-width: auto;
        margin-bottom: 0.25rem;
    }
    
    .scroll-progress {
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
    }
    
    .scroll-progress .dot::before {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .panel.color2-alt .inner.columns .span-2-5 h3.major {
        font-size: 1.75rem;
    }
    
    .scroll-progress {
        bottom: 0.5rem;
    }
}

/* ========================================
   LOADING STATE ENHANCEMENTS
   ======================================== */

body.is-preload .panel .content,
body.is-preload .panel .intro,
body.is-preload .panel .inner {
    opacity: 0;
}

body:not(.is-preload) .panel .content,
body:not(.is-preload) .panel .intro,
body:not(.is-preload) .panel .inner {
    animation: fadeInUp var(--duration-slow) var(--ease-out-expo) forwards;
}

/* ========================================
   CURSOR ENHANCEMENTS
   ======================================== */

.button,
.scroll-progress .dot,
.contact-icons li a {
    cursor: pointer;
}

/* ========================================
   SELECTION STYLING
   ======================================== */

::selection {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

::-moz-selection {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ========================================
   SCROLLBAR STYLING (Webkit)
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1);
}
