/* ==========================================================================
   RESEARCHPLUGHUB V2.0 — BASE STYLES & FONTS
   ========================================================================== */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');

/* --- Modern CSS Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.625;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

/* --- Premium Selection Color --- */
::selection {
    background-color: rgba(142, 124, 104, 0.15); /* Soft transparent Warm Bronze */
    color: var(--text-primary);
}

/* --- Accessibility (Skip to content link) --- */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-sm);
    background-color: var(--accent-blue);
    color: #FFFFFF;
    padding: var(--space-xs) var(--space-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    z-index: 99999;
    text-decoration: none;
    transition: var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-sm);
    outline: 2px solid var(--text-primary);
}

/* --- Reusable Global Layout Containers --- */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

/* --- Editorial Grid Layout System --- */
.editorial-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-md);
}

/* --- Editorial Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: var(--space-xs);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    letter-spacing: -0.02em;
    font-weight: 600;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    letter-spacing: -0.01em;
    font-weight: 600;
}

h4 {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: -0.01em;
}

p {
    color: var(--text-secondary);
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    margin-bottom: var(--space-sm);
}

p.lead {
    font-family: var(--font-body);
    font-size: clamp(1.125rem, 1.5vw, 1.35rem);
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.6;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    transition: var(--transition-fast);
}

a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* --- Editorial Divider Lines --- */
hr.editorial-line {
    border: none;
    border-top: 1px solid var(--border-editorial);
    margin: var(--space-lg) 0;
    width: 100%;
}

/* --- Styled Elite Badges --- */
.editorial-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-pill);
    color: var(--color-accent);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
}

/* --- Common Organic Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background-color: var(--text-primary); /* Deep charcoal background */
    color: var(--bg-primary);
    border-color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(30, 28, 25, 0.02);
    transition: all 0.25s ease;
}

.btn-primary:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--bg-primary);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(139, 94, 60, 0.15); /* Soft, luxurious bronze shadow */
    transition: all 0.25s ease;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-editorial-dark);
    transition: all 0.25s ease;
}

.btn-secondary:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--bg-primary);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(139, 94, 60, 0.15);
    transition: all 0.25s ease;
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform var(--transition-fast);
}

.btn:hover .btn-icon {
    transform: translateX(3px);
}

/* --- Dynamic Global Utility Layouts --- */
.section-padding {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
    position: relative;
}

@media (max-width: 768px) {
    .section-padding {
        padding-top: var(--space-lg);
        padding-bottom: var(--space-lg);
    }
}

/* --- Ambient Mouse Glow & Background Grid Boards --- */
.ambient-glow-wrapper {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.ambient-gold-glow {
    position: absolute;
    top: var(--glow-y, -9999px);
    left: var(--glow-x, -9999px);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(142, 124, 104, 0.08) 0%, rgba(252, 250, 247, 0) 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    transition: transform 0.15s ease-out;
}

/* Page background fine grid guides */
.bg-grid-guides {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1280px;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    pointer-events: none;
    z-index: -1;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

.bg-grid-guide-line {
    border-right: 1px dashed rgba(232, 226, 217, 0.4);
    height: 100%;
}

.bg-grid-guide-line:first-child {
    border-left: 1px dashed rgba(232, 226, 217, 0.4);
}

/* ── Floating Contact Buttons ── */
.floating-contacts {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: flex-end;
    pointer-events: auto;
}

.float-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    color: #FCFAF7;
    box-shadow: var(--shadow-subtle), 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: var(--transition-fast);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    width: 150px;
    justify-content: center;
}

.float-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium), 0 8px 20px rgba(0, 0, 0, 0.12);
    color: #FCFAF7;
}

.float-btn.whatsapp {
    background: #25D366; /* Standard WhatsApp Green */
    border-color: rgba(37, 211, 102, 0.2);
}

.float-btn.whatsapp:hover {
    background: #1eaf53;
}

.float-btn.email {
    background: var(--color-accent); /* Deep Bronze Accent! (No Blue) */
    border-color: rgba(139, 94, 60, 0.2);
}

.float-btn.email:hover {
    background: #734d30;
}

.float-btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Responsive compact icon-only float-btns on mobile */
@media (max-width: 768px) {
    .floating-contacts {
        bottom: 1rem;
        right: 1rem;
        gap: 0.5rem;
    }
    .float-btn {
        padding: 0.65rem;
        border-radius: 50%;
        width: 42px;
        height: 42px;
        justify-content: center;
    }
    .float-btn span {
        display: none; /* Hide button text */
    }
}

/* ==========================================================================
   PREMIUM GLASSMORPHIC SCROLL TO TOP (v2.0 Refined)
   ========================================================================== */
.scroll-to-top {
    position: fixed;
    bottom: 140px; /* Floats perfectly above the 2-button floating contacts on desktop */
    right: 32px;
    width: 46px;
    height: 46px;
    background-color: rgba(252, 250, 247, 0.85); /* Frosted oatmeal cream */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 0.5px solid rgba(139, 94, 60, 0.4); /* Fine bronze border */
    border-radius: 50%;
    cursor: pointer;
    z-index: 10000; /* Float visually on top of contacts container stack (9999) */
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.scroll-to-top:hover {
    background-color: #F5F2ED;
    box-shadow: 0 6px 20px rgba(139, 94, 60, 0.15); /* Soft bronze glow */
    transform: scale(1.05) translateY(-2px);
}

.scroll-to-top .progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg); /* Start progress from top */
}

.scroll-to-top .progress-ring__circle {
    transition: stroke-dashoffset 0.1s linear;
}

.scroll-to-top .arrow-icon {
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-to-top:hover .arrow-icon {
    transform: translateY(-2px);
}

/* Flipped state when scrolling down */
.scroll-to-top.scroll-down .arrow-icon {
    transform: rotate(180deg);
}

/* Maintain proper hover translation direction when flipped */
.scroll-to-top.scroll-down:hover .arrow-icon {
    transform: rotate(180deg) translateY(2px);
}

/* Adjust scroll-to-top placement to sit neatly above circular mobile floaters */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 118px; /* Increased from 105px to give a clean 10px layout gap above WhatsApp */
        right: 14px;  /* Perfectly centered with circular 42px mobile buttons */
    }
}

/* --- Global Layout Overflow Safety Reset --- */
html, body {
    max-width: 100vw;
    overflow-x: clip !important;
}
