/* 
  Mexto Consulting - Component Styles (2026 Core)
  Includes: Navbar, Mega Menu, Buttons, Cards, Bento Grid, Timeline, Footer, Grid Lines, Background Blobs
*/

/* --- BACKGROUND DECORATION EFFECTS --- */
@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -50px) scale(1.08); }
    100% { transform: translate(0, 0) scale(1); }
}

.glowing-bg-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(34, 199, 184, 0.12) 0%, rgba(13, 139, 132, 0.03) 50%, rgba(0, 0, 0, 0) 100%);
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
    animation: floatBlob 20s infinite ease-in-out;
}

.blob-1 { top: -200px; right: -100px; }
.blob-2 { bottom: -200px; left: -100px; animation-delay: -7s; }

/* Grid overlay to give the McKinsey/Stripe technical feel */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-size: 80px 80px;
    background-image: 
        linear-gradient(to right, rgba(13, 139, 132, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(13, 139, 132, 0.03) 1px, transparent 1px);
    z-index: -1;
    pointer-events: none;
}

/* Glassmorphism utility */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(30, 47, 69, 0.06);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.dark-theme .glass-panel {
    background: rgba(30, 47, 69, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.2);
}

/* --- HEADER & NAVIGATION --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background var(--transition-normal), padding var(--transition-normal), border-color var(--transition-normal);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid transparent;
}

header.scrolled {
    padding: 0.8rem 2rem;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(30, 47, 69, 0.06);
    box-shadow: var(--shadow-sm);
}

header.scrolled.dark-header {
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.75rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-family: var(--font-heading);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-navy);
    letter-spacing: -0.03em;
    transition: color var(--transition-fast);
}

.dark-header .logo-text,
.dark-theme .logo-text {
    color: var(--text-light);
}

.logo-text span {
    color: var(--primary);
}

/* Nav Links & Hover Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.25rem;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dark-header .nav-link,
.dark-theme .nav-link {
    color: var(--text-light);
}

.nav-link:hover, .nav-item:hover > .nav-link {
    color: var(--primary);
}

.nav-link svg {
    transition: transform var(--transition-fast);
}

.nav-item:hover .nav-link svg {
    transform: rotate(180deg);
}

/* Mega Menu / Dropdown structure */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    opacity: 0;
    visibility: hidden;
    width: 280px;
    background: white;
    border: 1px solid rgba(30, 47, 69, 0.08);
    border-radius: 12px;
    padding: 0.75rem 0;
    box-shadow: var(--shadow-lg);
    transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal);
    z-index: 100;
}

.dark-header .dropdown-menu,
.dark-theme .dropdown-menu {
    background: var(--bg-dark);
    border-color: rgba(255, 255, 255, 0.08);
}

.dropdown-item {
    list-style: none;
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.dark-header .dropdown-link,
.dark-theme .dropdown-link {
    color: var(--text-light);
}

.dropdown-link:hover {
    background: rgba(13, 139, 132, 0.05);
    color: var(--primary);
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Header buttons */
.header-cta {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white !important;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 199, 184, 0.25);
}

.mobile-cta {
    display: none;
}

.logo-svg,
.logo-link .logo-img {
    transition: transform var(--transition-normal);
}

.logo-link .logo-img {
    display: none;
    height: 40px !important;
    max-height: 40px !important;
    width: auto !important;
}

/* Default state (light header / default content): show dark logo */
.logo-link .logo-dark-img {
    display: inline-block;
}

/* Dark header, dark theme, or footer context: hide dark logo, show light logo */
.dark-header .logo-link .logo-dark-img,
.dark-theme .logo-link .logo-dark-img,
footer .logo-link .logo-dark-img {
    display: none;
}

.dark-header .logo-link .logo-light-img,
.dark-theme .logo-link .logo-light-img,
footer .logo-link .logo-light-img {
    display: inline-block;
}

.logo-link:hover .logo-svg,
.logo-link:hover .logo-img {
    transform: scale(1.03);
}

/* Staggered Nav Item Fade-in */
@keyframes fadeInDown {
    0% { opacity: 0; transform: translateY(-15px); }
    100% { opacity: 1; transform: translateY(0); }
}

.nav-menu .nav-item {
    opacity: 0;
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.nav-menu .nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-menu .nav-item:nth-child(2) { animation-delay: 0.12s; }
.nav-menu .nav-item:nth-child(3) { animation-delay: 0.19s; }
.nav-menu .nav-item:nth-child(4) { animation-delay: 0.26s; }
.nav-menu .nav-item:nth-child(5) { animation-delay: 0.33s; }
.nav-menu .nav-item:nth-child(6) { animation-delay: 0.40s; }

/* 3D Entry Slide-in for Hero Visual Glass Cards */
@keyframes slideFromLeft {
    0% { opacity: 0; transform: translate(-80px, 40px) rotate(-15deg); filter: blur(8px); }
    100% { opacity: 1; transform: translate(0, 0) rotate(-4deg); filter: blur(0); }
}
@keyframes slideFromRight {
    0% { opacity: 0; transform: translate(80px, 40px) rotate(15deg); filter: blur(8px); }
    100% { opacity: 1; transform: translate(0, 0) rotate(2deg); filter: blur(0); }
}
@keyframes slideFromBottom {
    0% { opacity: 0; transform: translate(0, 80px) rotate(-20deg); filter: blur(8px); }
    100% { opacity: 0.9; transform: translate(0, 0) rotate(-8deg); filter: blur(0); }
}

.hero-visual .glass-panel:nth-child(1) {
    animation: slideFromLeft 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-visual .glass-panel:nth-child(2) {
    animation: slideFromRight 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-visual .glass-panel:nth-child(3) {
    animation: slideFromBottom 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mobile Burger Menu Icon */
.burger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    position: relative;
    z-index: 1001;
    flex-shrink: 0;
}

.burger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--dark-navy) !important;
    position: absolute;
    left: 10px; /* Center horizontally: (44px width - 24px line width) / 2 */
    transition: transform var(--transition-normal), top var(--transition-normal), bottom var(--transition-normal), opacity var(--transition-normal);
}

.dark-header .burger-line,
.dark-theme .burger-line {
    background-color: var(--text-light) !important;
}

.burger-line-1 { top: 14px; }
.burger-line-2 { top: 21px; }
.burger-line-3 { top: 28px; }

header.mobile-open .burger-line-1 {
    transform: rotate(45deg);
    top: 21px;
}
header.mobile-open .burger-line-2 {
    opacity: 0;
}
header.mobile-open .burger-line-3 {
    transform: rotate(-45deg);
    top: 21px;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(34, 199, 184, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34, 199, 184, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--dark-navy);
    border: 2px solid var(--primary);
}

.dark-theme .btn-secondary {
    color: var(--text-light);
    border-color: var(--accent);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.dark-theme .btn-secondary:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-link {
    color: var(--primary);
    font-weight: 600;
    padding: 0;
    background: none;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.dark-theme .btn-link {
    color: var(--accent);
}

.btn-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width var(--transition-normal);
}

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

.btn-link svg {
    transition: transform var(--transition-fast);
}

.btn-link:hover svg {
    transform: translateX(4px);
}

/* --- TRUST METRICS --- */
.metrics-section {
    background: linear-gradient(to bottom, #FFFFFF, var(--bg-light));
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 5rem 2rem;
}

.dark-theme.metrics-section {
    background: linear-gradient(to bottom, #152233, var(--bg-dark));
    border-top: 1px solid var(--border-dark);
    border-bottom: 1px solid var(--border-dark);
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.metric-item {
    text-align: center;
    padding: 1.5rem;
}

.metric-number {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

.metric-label {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark-navy);
    letter-spacing: -0.01em;
}

.dark-theme .metric-label {
    color: var(--text-light);
}

/* --- SERVICE CARD BLOCKS --- */
.service-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    transition: height var(--transition-normal);
}

.service-card:hover::before {
    height: 100%;
}

.service-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(13, 139, 132, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.dark-theme .service-icon-box {
    background: rgba(34, 199, 184, 0.1);
    color: var(--accent);
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--dark-navy);
}

.dark-theme .service-card h3 {
    color: var(--text-light);
}

.service-card p {
    margin-bottom: 2rem;
    flex-grow: 1;
}

/* --- INDUSTRIES PREVIEW --- */
.industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.industry-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    transition: all var(--transition-normal);
}

.industry-card:hover {
    background: white;
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.dark-theme .industry-card:hover {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: none;
    border-color: var(--accent);
}

.industry-image-wrapper {
    width: 100%;
    height: 130px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.industry-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.industry-card:hover .industry-image-wrapper img {
    transform: scale(1.06);
}

.industry-card h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark-navy);
    margin-top: 0.5rem;
    transition: color var(--transition-fast);
}

.dark-theme .industry-card h4 {
    color: var(--text-light);
}

.industry-card:hover h4 {
    color: var(--primary);
}

/* Logo Link and Color Fixes to prevent purple visited state */
.logo-link,
.logo-link:visited {
    color: var(--dark-navy) !important;
}

.dark-header .logo-link,
.dark-header .logo-link:visited,
.dark-theme .logo-link,
.dark-theme .logo-link:visited,
footer .logo-link,
footer .logo-link:visited {
    color: var(--text-light) !important;
}

.logo-link:hover {
    color: var(--primary) !important;
    text-decoration: none;
}


/* --- BENTO GRID (WHY MEXTO) --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 1.5rem;
}

.bento-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: scale(1.01);
}

.bento-card.col-2 {
    grid-column: span 2;
}

.bento-card.row-2 {
    grid-row: span 2;
}

.bento-card-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13, 139, 132, 0.08) 0%, transparent 100%);
    z-index: -1;
}

.bento-title {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.bento-meta {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.bento-number {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    color: rgba(30, 47, 69, 0.05);
    position: absolute;
    bottom: 1.5rem;
    right: 2rem;
    transition: color var(--transition-normal);
}

.bento-card:hover .bento-number {
    color: rgba(34, 199, 184, 0.15);
}

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-card.col-2 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-card.col-2 {
        grid-column: span 1;
    }
}

/* --- ABOUT US / TIMELINE --- */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 4rem auto 0 auto;
    padding: 2rem 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: rgba(13, 139, 132, 0.15);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-item {
    padding: 2rem 3rem;
    position: relative;
    background: transparent;
    width: 50%;
    margin-bottom: 2rem;
}

.timeline-item-left {
    left: 0;
    text-align: right;
}

.timeline-item-right {
    left: 50%;
}

.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background: var(--primary);
    border: 4px solid var(--bg-light);
    border-radius: 50%;
    top: 2.5rem;
    z-index: 10;
    box-shadow: 0 0 0 4px rgba(13, 139, 132, 0.2);
    transition: transform var(--transition-fast);
}

.dark-theme .timeline-dot {
    border-color: var(--bg-dark);
}

.timeline-item-right .timeline-dot {
    left: -8px;
    right: auto;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    background: var(--accent);
}

.timeline-year {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.timeline-content {
    padding: 2.25rem;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .timeline::after {
        left: 2rem;
    }
    .timeline-item {
        width: 100%;
        left: 0;
        padding-left: 5rem;
        padding-right: 1rem;
        text-align: left;
    }
    .timeline-dot {
        left: 2rem !important;
        right: auto !important;
        margin-left: -8px;
    }
}

/* --- FOOTER --- */
footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 6rem 2rem 2rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 4rem;
    margin-bottom: 5rem;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.footer-brand h4 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
}

.footer-brand p {
    color: var(--text-muted-light);
    margin-bottom: 2rem;
    max-width: 320px;
}

.social-links {
    display: flex;
    gap: 1.25rem;
}

.social-icon-link {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted-light);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-icon-link:hover {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.footer-title {
    color: white;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-muted-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--text-muted-light);
    font-size: 0.95rem;
}

.footer-contact-info div {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.footer-phones {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-contact-info a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-contact-info a:hover {
    color: var(--accent);
}

.footer-contact-info svg {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 3px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted-light);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Developer Link styling */
.developer-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    border-bottom: 1px dashed transparent;
}

.developer-link:hover {
    color: white;
    border-bottom-color: white;
}

