/* ============================================
   ROFLOTECH SOFTWORKS - MODERN LAYER
   Loaded after styles.css. Adds the animated,
   modern treatment on top of the existing design.
   ============================================ */

:root {
    --m-blue: #007bff;
    --m-cyan: #38bdf8;
    --m-violet: #7c5cff;
    --m-navy: #002c68;
    --m-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body,
button, input, select, textarea {
    font-family: 'Plus Jakarta Sans', 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

h1, h2, h3, h4 { letter-spacing: -0.02em; }

::selection { background: var(--m-blue); color: #fff; }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--m-cyan);
    outline-offset: 3px;
}

/* ---------- Animated gradient text ---------- */
.gradient-text {
    background: linear-gradient(90deg, var(--m-blue), var(--m-cyan), var(--m-violet), var(--m-blue));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradientSlide 6s linear infinite;
}
@keyframes gradientSlide { to { background-position: 300% 0; } }

/* ---------- Button shine sweep ---------- */
.btn-shine { position: relative; overflow: hidden; isolation: isolate; }
.btn-shine::after {
    content: '';
    position: absolute; top: 0; bottom: 0; left: -80%;
    width: 50%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
    animation: shineSweep 4.5s ease-in-out infinite;
}
@keyframes shineSweep {
    0%, 60% { left: -80%; }
    100% { left: 140%; }
}

/* ============================================
   HEADER: glass, shrinks on scroll, working mobile menu
   ============================================ */
.site-header {
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid rgba(0, 44, 104, 0.08);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}
.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px rgba(0, 44, 104, 0.12);
}

.scroll-progress {
    position: absolute; left: 0; bottom: -1px;
    height: 3px; width: 100%;
    transform-origin: left center;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--m-blue), var(--m-cyan), var(--m-violet));
}

.brand img { transition: transform 0.6s var(--m-ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.brand-name { font-size: 1.35rem; font-weight: 800; color: #1e3352; white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: 2rem; font-weight: 600; color: #475569; }

.nav-link { position: relative; padding: 0.35rem 0; transition: color 0.25s ease; }
.nav-link::after {
    content: '';
    position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--m-blue), var(--m-cyan));
    transform: scaleX(0); transform-origin: right;
    transition: transform 0.35s var(--m-ease);
}
.nav-link:hover, .nav-link.is-active { color: var(--m-blue); }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav-cta {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.7rem 1.4rem;
    border-radius: 0.6rem;
    color: #fff; font-weight: 700;
    background: linear-gradient(135deg, #2563eb, var(--m-blue));
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
    transition: transform 0.25s var(--m-ease), box-shadow 0.25s ease;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(37, 99, 235, 0.5); }

.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    border-radius: 0.6rem;
    border: 1px solid rgba(0, 44, 104, 0.15);
    background: #fff;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    cursor: pointer;
}
.nav-toggle span {
    display: block; width: 20px; height: 2px; border-radius: 2px;
    background: var(--m-navy);
    transition: transform 0.3s var(--m-ease), opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1023px) {
    .nav-toggle { display: inline-flex; }
    .brand-name { font-size: 1.15rem; }
    .site-nav {
        position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 0.5rem 1.25rem 1.25rem;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid rgba(0, 44, 104, 0.1);
        box-shadow: 0 24px 40px rgba(0, 44, 104, 0.15);
        opacity: 0; visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.25s ease, transform 0.3s var(--m-ease), visibility 0.25s;
    }
    .site-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
    .site-nav .nav-link { padding: 0.9rem 0.25rem; border-bottom: 1px solid rgba(0, 44, 104, 0.08); }
    .site-nav .nav-link::after { display: none; }
    .nav-cta { margin-top: 1rem; }
}

/* ============================================
   HERO: animated aurora, grid, cursor spotlight
   ============================================ */
#hero.hero-modern {
    min-height: min(88vh, 860px);
    padding: 6rem 0 7rem;
    overflow: hidden;
    isolation: isolate;
}
/* deeper, richer overlay than the flat blue wash */
#hero.hero-modern::before {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(0, 123, 255, 0.35), transparent 60%),
        linear-gradient(180deg, rgba(0, 20, 54, 0.9), rgba(0, 44, 104, 0.88));
}

.hero-fx { position: absolute !important; inset: 0; z-index: 1 !important; pointer-events: none; overflow: hidden; }

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    will-change: transform;
}
.hero-blob-1 { width: 520px; height: 520px; left: -140px; top: -160px; background: var(--m-blue); animation: blobA 16s ease-in-out infinite; }
.hero-blob-2 { width: 460px; height: 460px; right: -120px; top: 10%; background: var(--m-violet); animation: blobB 20s ease-in-out infinite; }
.hero-blob-3 { width: 420px; height: 420px; left: 35%; bottom: -220px; background: var(--m-cyan); opacity: 0.4; animation: blobC 18s ease-in-out infinite; }

@keyframes blobA { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(160px, 90px) scale(1.2); } }
@keyframes blobB { 0%, 100% { transform: translate(0, 0) scale(1.1); } 50% { transform: translate(-140px, 120px) scale(0.9); } }
@keyframes blobC { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-120px, -110px) scale(1.25); } }

.hero-grid-lines {
    position: absolute; inset: -2px;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 72%);
    mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 72%);
    animation: gridDrift 14s linear infinite;
}
@keyframes gridDrift { to { background-position: 56px 56px, 56px 56px; } }

.hero-spotlight {
    position: absolute; left: 0; top: 0;
    width: 560px; height: 560px; margin: -280px 0 0 -280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 62%);
    transform: translate3d(var(--sx, 50vw), var(--sy, 30vh), 0);
    transition: transform 0.25s ease-out, opacity 0.4s ease;
    opacity: 0;
}
#hero:hover .hero-spotlight { opacity: 1; }

.hero-inner { width: 100%; }

.hero-pill {
    display: inline-flex; align-items: center; gap: 0.6rem;
    margin: 0 0 1.75rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem; font-weight: 600; line-height: 1.3;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.hero-pill-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    animation: dotPulse 2s ease-out infinite;
}
@keyframes dotPulse { to { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); } }

.hero-title {
    font-size: clamp(2.2rem, 6vw, 4.25rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin: 0 0 1.5rem;
    text-wrap: balance;
}
.hero-title-line { display: block; min-height: 1.2em; }
.hero-title .gradient-text {
    background-image: linear-gradient(90deg, #7dd3fc, #60a5fa, #c4b5fd, #7dd3fc);
}
.hero-title .cursor { color: #7dd3fc; }

.hero-sub {
    max-width: 44rem;
    margin: 0 auto 2.5rem;
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    line-height: 1.6;
    color: #dbeafe;
}
.hero-sub strong { color: #fff; font-weight: 800; }

.hero-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

.hero-ghost-btn {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: transform 0.3s var(--m-ease), background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.hero-ghost-btn:hover {
    transform: translateY(-3px);
    background: #fff; color: var(--m-navy);
    box-shadow: 0 14px 34px rgba(255, 255, 255, 0.25);
}

/* page-load entrance */
.hero-rise {
    opacity: 0;
    transform: translateY(28px);
    animation: heroRise 0.9s var(--m-ease) forwards;
    animation-delay: var(--d, 0s);
}
@keyframes heroRise { to { opacity: 1; transform: translateY(0); } }

/* scroll cue */
.hero-scroll {
    position: absolute !important;
    left: 50%; bottom: 1.75rem;
    width: 26px; height: 42px; margin-left: -13px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 14px;
}
.hero-scroll span {
    position: absolute; left: 50%; top: 7px;
    width: 4px; height: 8px; margin-left: -2px;
    border-radius: 2px; background: #fff;
    animation: scrollCue 1.8s ease-in-out infinite;
}
@keyframes scrollCue { 0% { transform: translateY(0); opacity: 1; } 80%, 100% { transform: translateY(14px); opacity: 0; } }

@media (max-width: 640px) {
    #hero.hero-modern { padding: 4rem 0 6rem; min-height: 0; }
    .hero-buttons a { width: 100%; text-align: center; }
    .hero-blob { filter: blur(50px); }
}

/* ============================================
   MARQUEE STRIP
   ============================================ */
.marquee {
    overflow: hidden;
    background: linear-gradient(90deg, var(--m-navy), #003d8f, var(--m-navy));
    color: #fff;
    padding: 0.95rem 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
    display: flex; width: max-content;
    animation: marquee 32s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
    display: inline-flex; align-items: center;
    font-weight: 700; font-size: 1rem; letter-spacing: 0.02em;
    white-space: nowrap;
    padding: 0 1.6rem;
}
.marquee-track span::after {
    content: '';
    width: 8px; height: 8px; margin-left: 3.2rem;
    border-radius: 2px; transform: rotate(45deg);
    background: var(--m-cyan);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================
   CARDS: 3D tilt, glow, reveal
   ============================================ */
.service-card[data-tilt].animate-in,
.portfolio-card[data-tilt].animate-in {
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
    transition: transform 0.5s var(--m-ease), box-shadow 0.4s ease, border-color 0.4s ease, opacity 0.6s ease;
    transform-style: preserve-3d;
    will-change: transform;
}
.service-card[data-tilt].is-tilting,
.portfolio-card[data-tilt].is-tilting {
    --lift: -10px;
    transition: transform 0.12s linear, box-shadow 0.4s ease, border-color 0.4s ease;
}

/* light that follows the pointer across a card */
[data-tilt] { position: relative; }
[data-tilt] .tilt-glare {
    position: absolute; inset: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.28), transparent 55%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 3;
}
[data-tilt].is-tilting .tilt-glare { opacity: 1; }

.service-card:hover { border-color: rgba(56, 189, 248, 0.7); box-shadow: 0 30px 70px rgba(0, 123, 255, 0.3); }
.service-card .service-icon-wrapper { animation: iconFloat 4s ease-in-out infinite; }
.service-card:nth-child(2) .service-icon-wrapper { animation-delay: 0.6s; }
.service-card:nth-child(3) .service-icon-wrapper { animation-delay: 1.2s; }
@keyframes iconFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

/* generic reveal used by testimonials, FAQ tiles, overview cards */
/* Items are hidden only after scripts.js adds .reveal-ready to <html>,
   so content always shows if the script is missing, cached or fails. */
.reveal-ready .reveal-up {
    opacity: 0;
    transform: translateY(36px) scale(0.98);
    transition: opacity 0.7s ease, transform 0.8s var(--m-ease);
    transition-delay: var(--reveal-delay, 0s);
}
.reveal-ready .reveal-up.animate-in { opacity: 1; transform: none; }

.reveal-ready .testimonial-card.reveal-up { transition: opacity 0.7s ease, transform 0.8s var(--m-ease), box-shadow 0.35s ease; }
.reveal-ready .testimonial-card.reveal-up.animate-in:hover { transform: translateY(-8px); box-shadow: 0 26px 60px rgba(0, 123, 255, 0.18); }

/* achievements */
.achievement-item { position: relative; overflow: hidden; }
.achievement-item::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(0, 123, 255, 0.12) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.9s var(--m-ease);
}
.achievement-item:hover::after { transform: translateX(100%); }
.counter { font-variant-numeric: tabular-nums; }

/* about slider: slow zoom on the visible slide */
.slide.active img { animation: kenBurns 6s ease-out forwards; }
@keyframes kenBurns { from { transform: scale(1.08); } to { transform: scale(1); } }

/* ============================================
   CONTACT FORM
   ============================================ */
.contact-form-card { position: relative; }
.contact-form-card::before {
    content: '';
    position: absolute; inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--angle, 0deg), transparent 0 70%, var(--m-cyan), var(--m-violet), transparent);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: borderSpin 6s linear infinite;
    pointer-events: none;
}
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes borderSpin { to { --angle: 360deg; } }

.contact-field input, .contact-field select, .contact-field textarea {
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s var(--m-ease);
}
.contact-field input:focus, .contact-field select:focus, .contact-field textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35), 0 12px 28px rgba(0, 123, 255, 0.25);
}
.contact-field [aria-invalid="true"] { border-color: #f87171 !important; }
.field-error { margin: 0.4rem 0 0; font-size: 0.85rem; line-height: 1.4; color: #fca5a5; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-submit[disabled] { opacity: 0.7; cursor: progress; }
.contact-submit .spinner {
    display: inline-block; width: 1em; height: 1em; margin-right: 0.5em;
    border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -0.15em;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-status:empty { display: none; }
.form-status {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 0.75rem;
    font-weight: 600; line-height: 1.5; text-align: left;
    animation: statusIn 0.5s var(--m-ease);
}
.form-status.is-ok { background: #d1fae5; color: #065f46; }
.form-status.is-error { background: #fee2e2; color: #991b1b; }
.form-status a { color: inherit; text-decoration: underline; }
@keyframes statusIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

/* ============================================
   FLOATING "TALK WITH US" BUBBLE
   ============================================ */
.chat-bubble-pulse::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    border: 2px solid var(--m-blue);
    animation: bubblePulse 2.4s ease-out infinite;
    pointer-events: none;
}
@keyframes bubblePulse { from { transform: scale(1); opacity: 0.8; } to { transform: scale(1.5); opacity: 0; } }

/* footer logo was oversized */
footer a img { width: 56px; height: auto; }

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .hero-rise, .reveal-ready .reveal-up, .scroll-animate, .stagger-item, .scale-up, .fade-left, .fade-right { opacity: 1 !important; transform: none !important; }
    .marquee-track { animation: none !important; }
}

/* hero has its own entrance; skip the generic section fade */
#hero.scroll-animate { opacity: 1; transform: none; }

@media (max-width: 420px) {
    .hero-title { font-size: 1.9rem; }
    .hero-title-line { white-space: nowrap; }
}
