/* =====================================================================
   Cloudsect — design & UX enhancements (shared by every page)
   Additive only: nothing in style.css is removed or overridden on desktop
   except where noted for the mobile menu.
   ===================================================================== */

/* ---------- Scroll progress ---------- */
.scroll-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1001;
    background: var(--grad-duo); transform-origin: 0 50%; transform: scaleX(0);
    pointer-events: none;
}

/* ---------- Back to top ---------- */
.to-top {
    position: fixed; right: 24px; bottom: 24px; z-index: 900;
    width: 48px; height: 48px; border-radius: 14px; border: none; cursor: pointer;
    background: var(--grad-primary); color: var(--white); font-size: 16px;
    display: grid; place-items: center;
    box-shadow: 0 14px 30px -10px rgba(47,111,228,0.6);
    opacity: 0; visibility: hidden; transform: translateY(14px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, box-shadow 0.3s ease;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { box-shadow: 0 18px 36px -10px rgba(230,57,70,0.55); background: var(--grad-duo); }
.to-top svg { width: 18px; height: 18px; }

/* ---------- Keyboard focus (accessibility) ---------- */
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--blue-300); outline-offset: 3px; border-radius: 10px;
}
.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 2000;
    background: var(--blue-700); color: var(--white); padding: 10px 18px;
    border-radius: var(--r-pill); font-size: 14px; font-weight: 600; transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Mobile navigation ---------- */
.nav-toggle {
    display: none; width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 12px; border: 1px solid var(--ink-200); background: var(--white);
    cursor: pointer; position: relative;
}
.nav-toggle span {
    position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px;
    background: var(--blue-800); transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; background: var(--red-500); }
.nav-toggle span:nth-child(3) { top: 27px; }
.navbar.menu-open .nav-toggle span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.navbar.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.navbar.menu-open .nav-toggle span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 809px) {
    .nav-inner { gap: 10px; }
    .nav-cta { margin-left: auto; }
    .nav-toggle { display: block; }
    .navbar.menu-open .nav-menu {
        display: flex; flex-direction: column; align-items: stretch; gap: 2px;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--white); padding: 10px 20px 22px;
        border-bottom: 1px solid var(--ink-200);
        box-shadow: 0 24px 40px -20px rgba(16,46,112,0.25);
        max-height: calc(100vh - 80px); overflow-y: auto;
        animation: menuDrop 0.25s ease;
    }
    .navbar.menu-open .nav-link { padding: 13px 14px; border-radius: 12px; font-size: 15px; }
    .navbar.menu-open .nav-link::after { display: none; }
    .navbar.menu-open .nav-link.active, .navbar.menu-open .nav-link:hover { background: var(--blue-50); }
}
@media (max-width: 480px) {
    .navbar, .navbar.scrolled { padding-left: 16px; padding-right: 16px; }
    .nav-cta { padding: 9px 14px; font-size: 13px; }
    .nav-logo-img, .navbar.scrolled .nav-logo-img { height: 34px; }
    .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}
@keyframes menuDrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Capabilities: sticky, working tabs ---------- */
@media (min-width: 810px) {
    .cap-tabs { position: sticky; top: 84px; z-index: 20; }
}
.cap-panel { scroll-margin-top: 170px; }
.cap-panel.is-focus { animation: panelFocus 1.8s ease; }
@keyframes panelFocus {
    0%, 60% { box-shadow: 0 0 0 3px var(--red-400), 0 32px 60px -22px rgba(47,111,228,0.7); }
    100% { box-shadow: 0 20px 44px -22px rgba(47,111,228,0.55); }
}

/* ---------- Form status messages (replaces browser alerts) ---------- */
.form-status {
    display: none; align-items: flex-start; gap: 10px; margin-top: 14px;
    padding: 12px 14px; border-radius: var(--r-md); font-size: 13.5px; line-height: 1.55;
}
.form-status.show { display: flex; animation: menuDrop 0.25s ease; }
.form-status.success { background: #ecfdf3; border: 1px solid #a6e9c1; color: #0f6b3a; }
.form-status.error { background: var(--red-50); border: 1px solid var(--red-200); color: var(--red-700); }
.form-status svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.newsletter-status { min-height: 0; margin-top: 10px; font-size: 12.5px; line-height: 1.5; }
.newsletter-status.success { color: #7ee2a8; }
.newsletter-status.error { color: var(--red-300); }
button[disabled] { cursor: wait; opacity: 0.85; }

/* ---------- Team role icons (inline SVG, shared look) ---------- */
.ti .wave { transition: opacity 0.4s ease; }
.ti .draw { stroke-dasharray: 100; stroke-dashoffset: 0; }
.team-card:hover .ti .draw { animation: tiDraw 0.9s ease both; }
.team-card:hover .ti .draw.d2 { animation-delay: 0.15s; }
.team-card:hover .ti .draw.d3 { animation-delay: 0.3s; }
.team-card:hover .ti .wave { animation: tiWave 1.2s ease-in-out infinite; }
.team-card:hover .ti .wave.d2 { animation-delay: 0.25s; }
@keyframes tiDraw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes tiWave { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- Small polish ---------- */
::selection { background: var(--blue-200); color: var(--ink-900); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important; scroll-behavior: auto !important;
    }
}
