/* ============================================================
   O.T. PRO CONTROL — Global UI/UX Theme
   "Modern Electrical Engineering" — Circuit / Grid + Components
   ============================================================ */

/* ---------- 0. Mobile Horizontal-Overflow Safety (global) ---------- */
/* Prevents the document from ever exceeding the viewport width on small
   screens. `overflow-x: clip` is preferred over `hidden` because it does NOT
   establish a new scroll container, so `position: sticky` (top header) keeps
   working. Older browsers fall back to `overflow-x: hidden`. */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

/* ---------- 1. Global Circuit / Grid Background ---------- */
body {
    background-color: #f9fafb; /* fallback (matches bg-gray-50) */
    background-image:
        linear-gradient(rgba(227, 31, 38, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(227, 31, 38, 0.045) 1px, transparent 1px);
    background-size: 34px 34px;
    /* `fixed` attachment is broken/unsupported on iOS & some Android browsers
       and can mis-scale the grid background + force horizontal overflow on
       mobile — use `scroll` (safe default) and only enable `fixed` on desktop. */
    background-attachment: scroll;
}

@media (min-width: 768px) {
    body {
        background-attachment: fixed;
    }
}

/* Optional: stronger circuit-style texture for primary sections.
   Add class="circuit-bg relative overflow-hidden" to a section. */
.circuit-bg {
    position: relative;
    overflow: hidden;
}
.circuit-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 18px 18px, rgba(227, 31, 38, 0.12) 2px, transparent 2.5px),
        linear-gradient(rgba(227, 31, 38, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(227, 31, 38, 0.06) 1px, transparent 1px);
    background-size: 34px 34px, 34px 34px, 34px 34px;
    z-index: 0;
}
.circuit-bg > * {
    position: relative;
    z-index: 1;
}

/* ---------- 2. Card Component (Hover Lift + Glow) ---------- */
.card-lift {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
    will-change: transform;
}
.card-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(227, 31, 38, 0.14), 0 8px 24px rgba(0, 0, 0, 0.10);
    border-color: rgba(227, 31, 38, 0.35);
}

/* ---------- 3. Industrial Button (Light Sweep) ---------- */
.btn-industrial {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.btn-industrial::before {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
    transform: skewX(-25deg);
    transition: left 0.55s ease;
    pointer-events: none;
}
.btn-industrial:hover::before {
    left: 130%;
}
.btn-industrial:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(227, 31, 38, 0.35);
}

/* ---------- 4. Heading Accent Line ---------- */
.heading-accent {
    position: relative;
    padding-bottom: 0.55rem;
}
.heading-accent::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #e31f26 0%, #ff6b30 100%);
    transition: width 0.45s ease;
}
.heading-accent:hover::after {
    width: 110px;
}

/* ---------- 5. Motion Safety ---------- */
@media (prefers-reduced-motion: reduce) {
    [data-aos],
    .card-lift,
    .btn-industrial {
        transition: none !important;
    }
}

