/**
 * HIFISYS Global Design System & Interactive Reference Effects
 * Namespace: .hfs-*
 *
 * Implements:
 * 1. Animated Heading Underline (.hfs-hover-underline)
 * 2. Two-Face Card Hover Animation (.hfs-twoface-card, .face1, .face2)
 * 3. Circular 360-degree Social Icon Fill (.hfs-social-icon)
 * 4. Nav Menu Dual Border & Fill Reveal (.hfs-nav-link)
 * 5. About Journey Timeline Aircraft Track & Blur Reveal (.hfs-journey-timeline)
 *
 * Built for enterprise responsiveness, accessible fallbacks & reduced motion.
 */

:root {
    --hfs-gold: #E6A622;
    --hfs-gold-light: #FBB040;
    --hfs-orange: #EA580C;
    --hfs-dark: #0F172A;
    --hfs-slate-900: #0F172A;
    --hfs-slate-800: #1E293B;
    --hfs-slate-700: #334155;
    --hfs-blur: 4px;
}

/* ==========================================================================
   1. PREMIUM ANIMATED HEADING UNDERLINE (.hfs-hover-underline)
   ========================================================================== */
.hfs-hover-underline {
    position: relative;
    display: inline-block;
    color: inherit;
    transition: color 0.3s ease;
}

.hfs-hover-underline::after,
.hfs-hover-underline::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #E6A622 0%, #EA580C 100%);
    bottom: -6px;
    left: 0;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 9999px;
    pointer-events: none;
}

.hfs-hover-underline::before {
    bottom: auto;
    top: -6px;
    transform-origin: left;
}

/* Hover & Active / Viewport-Triggered States */
.hfs-hover-underline:hover::after,
.hfs-hover-underline:hover::before,
.hfs-hover-underline.is-revealed::after,
.hfs-hover-underline.is-revealed::before,
.group:hover .hfs-hover-underline::after,
.group:hover .hfs-hover-underline::before {
    transform: scaleX(1);
}

/* Variant: Bottom Underline Only */
.hfs-hover-underline-bottom {
    position: relative;
    display: inline-block;
}

.hfs-hover-underline-bottom::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #E6A622 0%, #EA580C 100%);
    bottom: -4px;
    left: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
    border-radius: 9999px;
}

.hfs-hover-underline-bottom:hover::after,
.group:hover .hfs-hover-underline-bottom::after {
    transform: scaleX(1);
}

/* ==========================================================================
   2. PREMIUM TWO-FACE CARD HOVER ANIMATION (.hfs-twoface-card)
   ========================================================================== */
.hfs-twoface-card {
    position: relative;
    width: 100%;
    min-height: 400px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid #E2E8F0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
}

.hfs-twoface-card:hover,
.hfs-twoface-card:focus-within,
.hfs-twoface-card.is-active {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(230, 166, 34, 0.3);
}

.hfs-twoface-card .hfs-twoface-face {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Face 1: Main Content Layer (Revealed when Face 2 contracts) */
.hfs-twoface-card .hfs-twoface-face1 {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: #ffffff;
    z-index: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.hfs-twoface-card .hfs-twoface-face1::-webkit-scrollbar {
    display: none;
}

.hfs-twoface-card .hfs-twoface-face1 .hfs-card-content {
    padding-bottom: 4rem; /* Safe breathing room so bottom contracted strip doesn't obscure content */
}

/* Face 2: Initial Gradient Cover Layer with Massive Number */
.hfs-twoface-card .hfs-twoface-face2 {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-radius: 1.25rem;
    transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-radius 0.5s ease, background 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
    cursor: pointer;
}

/* Subtle Top Glass Sheen on Face 2 */
.hfs-twoface-card .hfs-twoface-face2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.25rem 0 0 1.25rem;
    pointer-events: none;
}

/* Card Number */
.hfs-twoface-card .hfs-twoface-face2 .hfs-twoface-number {
    margin: 0;
    padding: 0;
    font-size: clamp(5rem, 10vw, 7.5rem);
    font-weight: 900;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #ffffff;
    transition: font-size 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s ease, opacity 0.3s ease;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    line-height: 1;
    user-select: none;
}

/* Service Title preview on Face 2 */
.hfs-twoface-card .hfs-twoface-face2 .hfs-twoface-title-preview {
    position: absolute;
    bottom: 2rem;
    left: 1.5rem;
    right: 1.5rem;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: #F8FAFC;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hover Action: Face 2 contracts to a sleek bottom banner strip */
.hfs-twoface-card:hover .hfs-twoface-face2,
.hfs-twoface-card:focus-within .hfs-twoface-face2,
.hfs-twoface-card.is-active .hfs-twoface-face2 {
    height: 56px;
    border-radius: 0 0 1.25rem 1.25rem;
    background: linear-gradient(90deg, #0F172A 0%, #1E293B 100%);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.hfs-twoface-card:hover .hfs-twoface-face2 .hfs-twoface-number,
.hfs-twoface-card:focus-within .hfs-twoface-face2 .hfs-twoface-number,
.hfs-twoface-card.is-active .hfs-twoface-face2 .hfs-twoface-number {
    font-size: 1.5rem;
    transform: translateY(0);
}

.hfs-twoface-card:hover .hfs-twoface-face2 .hfs-twoface-title-preview,
.hfs-twoface-card:focus-within .hfs-twoface-face2 .hfs-twoface-title-preview,
.hfs-twoface-card.is-active .hfs-twoface-face2 .hfs-twoface-title-preview {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

/* Brand Palette Themes for Face 2 */
.hfs-card-theme-amber .hfs-twoface-face2 {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #B45309 100%);
}
.hfs-card-theme-orange .hfs-twoface-face2 {
    background: linear-gradient(135deg, #18181B 0%, #27272A 50%, #C2410C 100%);
}
.hfs-card-theme-slate .hfs-twoface-face2 {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 70%, #334155 100%);
}
.hfs-card-theme-gold .hfs-twoface-face2 {
    background: linear-gradient(135deg, #1E1B4B 0%, #0F172A 50%, #E6A622 100%);
}

/* ==========================================================================
   3. CIRCULAR 360-DEGREE SOCIAL ICON EFFECT (.hfs-social-icon)
   ========================================================================== */
.hfs-social-icon {
    width: 3rem;
    height: 3rem;
    background-color: #ffffff;
    text-align: center;
    line-height: 3rem;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 2px solid #E2E8F0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
}

.hfs-social-icon .icon {
    position: relative;
    color: #1E293B;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Color Slide Fill from Bottom */
.hfs-social-icon::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: #E6A622;
    transition: top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
    border-radius: 50%;
}

.hfs-social-icon:hover,
.hfs-social-icon:focus {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
    border-color: transparent;
}

.hfs-social-icon:hover::before,
.hfs-social-icon:focus::before {
    top: 0;
}

.hfs-social-icon:hover .icon,
.hfs-social-icon:focus .icon {
    color: #ffffff !important;
    transform: rotateY(360deg);
}

/* Network-Specific Fill Colors */
.hfs-social-facebook::before { background: #1877F2; }
.hfs-social-twitter::before  { background: #1DA1F2; }
.hfs-social-linkedin::before { background: #0A66C2; }
.hfs-social-youtube::before  { background: #FF0000; }
.hfs-social-instagram::before{ background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.hfs-social-whatsapp::before { background: #25D366; }
.hfs-social-email::before    { background: #EA580C; }
.hfs-social-phone::before    { background: #E6A622; }

/* Dark Background Variant for Footer */
.hfs-social-icon-dark {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}
.hfs-social-icon-dark .icon {
    color: #F8FAFC;
}

/* ==========================================================================
   4. NAVIGATION MENU CORNER BRACKET HOVER EFFECT (.hfs-nav-corner / .hfs-nav-link)
   ========================================================================== */
.hfs-nav-corner,
.hfs-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    height: 2.5rem; /* 40px fixed centerline height for active and resting states */
    padding: 0 0.65rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    text-transform: capitalize;
    text-decoration: none;
    color: #1E293B;
    background: transparent;
    transition: color 0.25s ease;
    z-index: 1;
    border-radius: 0;
    box-sizing: border-box;
}

@media (min-width: 1280px) {
    .hfs-nav-corner,
    .hfs-nav-link {
        padding: 0 0.75rem;
        font-size: 0.875rem;
    }
}

@media (min-width: 1536px) {
    .hfs-nav-corner,
    .hfs-nav-link {
        padding: 0 0.875rem;
        font-size: 0.875rem;
    }
}

/* Corner Bracket Pseudo-Elements (Zero width & height at rest) */
.hfs-nav-corner::before,
.hfs-nav-corner::after,
.hfs-nav-link::before,
.hfs-nav-link::after {
    content: "";
    position: absolute;
    display: block;
    width: 0;
    height: 0;
    border: 0 solid transparent;
    pointer-events: none;
    box-sizing: border-box;
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

/* Top-Left Corner Bracket (L-shape: top + left) */
.hfs-nav-corner::after,
.hfs-nav-link::after {
    top: 5px;
    left: 2px;
    border-top: 2px solid transparent;
    border-left: 2px solid transparent;
    border-right: 0;
    border-bottom: 0;
}

/* Bottom-Right Corner Bracket (L-shape: bottom + right) */
.hfs-nav-corner::before,
.hfs-nav-link::before {
    bottom: 5px;
    right: 2px;
    border-bottom: 2px solid transparent;
    border-right: 2px solid transparent;
    border-top: 0;
    border-left: 0;
}

/* Hover & Focus-Visible States: Reveal 10px x 10px Grey (#A6A6A6) Corner Brackets */
.hfs-nav-corner:hover::before,
.hfs-nav-corner:hover::after,
.hfs-nav-corner:focus-visible::before,
.hfs-nav-corner:focus-visible::after,
.hfs-nav-link:hover::before,
.hfs-nav-link:hover::after,
.hfs-nav-link:focus-visible::before,
.hfs-nav-link:focus-visible::after {
    width: 10px;
    height: 10px;
    border-color: #A6A6A6;
}

/* Subtle Hover Text Color without orange/yellow background fill */
.hfs-nav-corner:hover,
.hfs-nav-link:hover {
    color: #0F172A;
}

/* Accessible Focus-Visible */
.hfs-nav-corner:focus-visible,
.hfs-nav-link:focus-visible {
    outline: none;
    color: #0F172A;
}

/* Active State: Clean & Subtle Text Distinction (No Background Fill, No Top/Bottom Borders) */
.hfs-nav-corner.is-active,
.hfs-nav-link.is-active {
    color: #D97706; /* HIFISYS amber active brand color */
    font-weight: 700;
}

/* Active link still receives the corner bracket animation on hover */
.hfs-nav-corner.is-active:hover::before,
.hfs-nav-corner.is-active:hover::after,
.hfs-nav-link.is-active:hover::before,
.hfs-nav-link.is-active:hover::after {
    width: 10px;
    height: 10px;
    border-color: #A6A6A6;
}

/* ==========================================================================
   5. ABOUT US JOURNEY TIMELINE AIRCRAFT TRACK & BLUR REVEAL
   ========================================================================== */
.hfs-journey-timeline {
    position: relative;
    padding-left: 2rem;
}

@media (min-width: 768px) {
    .hfs-journey-timeline {
        padding-left: 6rem;
    }
}

/* The vertical dashed track */
.hfs-journey-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 1rem;
    width: 2px;
    background: repeating-linear-gradient(to bottom, #E6A622 0, #E6A622 8px, transparent 8px, transparent 16px);
    opacity: 0.4;
}

@media (min-width: 768px) {
    .hfs-journey-timeline::before {
        left: 2.5rem;
    }
}

/* The Tracking Aircraft / Airship Component */
.hfs-timeline-flyer {
    position: absolute;
    left: 0.25rem;
    top: 0;
    transform: translateY(0);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
    pointer-events: none;
}

@media (min-width: 768px) {
    .hfs-timeline-flyer {
        left: 1.25rem;
    }
}

.hfs-timeline-flyer svg {
    filter: drop-shadow(0 4px 10px rgba(230, 166, 34, 0.4));
}

.hfs-timeline-flyer .screw {
    transform-origin: 50% 46%;
    animation: hfs-propeller 150ms infinite linear;
}

@keyframes hfs-propeller {
    to {
        transform: rotate(360deg);
    }
}

/* Milestone Blur-to-Sharp Text Reveal */
.hfs-milestone-card {
    transition: filter 0.4s ease, opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hfs-milestone-card.is-blurred {
    filter: blur(var(--hfs-blur));
    opacity: 0.6;
}

.hfs-milestone-card:hover,
.hfs-milestone-card:focus-within,
.hfs-milestone-card.is-active,
.hfs-milestone-card.in-view {
    filter: blur(0);
    opacity: 1;
    transform: translateX(4px);
}

/* ==========================================================================
   6. ACCESSIBILITY & PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .hfs-hover-underline::before,
    .hfs-hover-underline::after,
    .hfs-twoface-card,
    .hfs-twoface-face2,
    .hfs-twoface-number,
    .hfs-social-icon,
    .hfs-social-icon::before,
    .hfs-social-icon .icon,
    .hfs-nav-corner::before,
    .hfs-nav-corner::after,
    .hfs-nav-link::before,
    .hfs-nav-link::after,
    .hfs-timeline-flyer,
    .hfs-milestone-card {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        transform: none !important;
        filter: none !important;
    }
    .hfs-timeline-flyer .screw {
        animation: none !important;
    }
}
