:root {
    --bg: #070b13;
    --panel: rgba(15, 23, 42, 0.76);
    --panel-strong: rgba(15, 23, 42, 0.92);
    --text: #f8fafc;
    --muted: #b7c3d6;
    --line: rgba(255, 255, 255, 0.16);
    --orange: #f59e0b;
    --yellow: #facc15;
    --cyan: #22d3ee;
    --green: #34d399;
    --red: #ef4444;
    --violet: #a78bfa;
    --shadow: 0 20px 58px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 18%, rgba(34, 211, 238, 0.18), transparent 28%),
        radial-gradient(circle at 84% 10%, rgba(245, 158, 11, 0.14), transparent 26%),
        linear-gradient(135deg, #070b13 0%, #0f172a 48%, #111827 100%);
    overflow-x: hidden;
    overflow-y: auto;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.2));
}

#siteCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.page-shell {
    position: relative;
    z-index: 1;
    min-height: 100svh;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 14px 0 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero {
    text-align: center;
    margin-bottom: 14px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 7px;
    padding: 5px 12px;
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 999px;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.08);
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.66rem;
}

h1 {
    margin: 0;
    font-size: clamp(1.95rem, 4.2vw, 3.3rem);
    line-height: 0.96;
    letter-spacing: -0.055em;
    text-wrap: balance;
}

.subtitle {
    margin: 8px auto 0;
    max-width: 600px;
    color: var(--muted);
    font-size: clamp(0.84rem, 1.25vw, 0.98rem);
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    perspective: 1200px;
}

.system-card {
    min-height: 156px;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    align-items: center;
    gap: 15px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    color: var(--text);
    text-decoration: none;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
    transform-style: preserve-3d;
    transition:
        transform 220ms ease,
        border-color 220ms ease,
        background 220ms ease,
        box-shadow 220ms ease;
    animation: revealCard 650ms ease both;
}

.system-card:nth-child(2) { animation-delay: 70ms; }
.system-card:nth-child(3) { animation-delay: 140ms; }
.system-card:nth-child(4) { animation-delay: 210ms; }
.system-card:nth-child(5) { animation-delay: 280ms; }
.system-card:nth-child(6) { animation-delay: 350ms; }

.system-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -2;
    opacity: 0;
    transition: opacity 220ms ease;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.32), transparent 34%);
}

.system-card::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 21px;
    z-index: -1;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.78));
}

.system-card:hover,
.system-card:focus-visible {
    transform: translateY(-5px) rotateX(3deg) rotateY(var(--tilt, 0deg));
    border-color: rgba(255, 255, 255, 0.34);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.50);
    outline: none;
}

.system-card:hover::before,
.system-card:focus-visible::before {
    opacity: 1;
}

.shine {
    position: absolute;
    top: -50%;
    left: -80%;
    width: 75%;
    height: 200%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transition: left 600ms ease;
    pointer-events: none;
}

.system-card:hover .shine,
.system-card:focus-visible .shine {
    left: 110%;
}

.icon-wrap {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
    transform: translateZ(18px);
}

.icon-wrap svg {
    width: 42px;
    height: 42px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-wrap .check {
    stroke: var(--green);
}

.card-obras .icon-wrap,
.card-obras .card-action { color: var(--green); }
.card-estoque .icon-wrap,
.card-estoque .card-action { color: var(--orange); }
.card-cdhu .icon-wrap,
.card-cdhu .card-action { color: var(--cyan); }
.card-licita .icon-wrap,
.card-licita .card-action { color: var(--violet); }
.card-sienge .card-action { color: #f87171; }

.logo-wrap {
    width: 100%;
    height: 66px;
    padding: 9px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
}

.sienge-logo {
    display: block;
    width: 100%;
    max-width: 190px;
    height: auto;
    object-fit: contain;
}

.card-content {
    display: grid;
    gap: 7px;
    min-width: 0;
    transform: translateZ(18px);
}

.card-title {
    display: block;
    font-size: clamp(0.98rem, 1.15vw, 1.16rem);
    font-weight: 850;
    line-height: 1.18;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.card-description {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.32;
}

.card-action {
    margin-top: 3px;
    font-weight: 800;
    font-size: 0.82rem;
}

.brand-card {
    cursor: default;
    grid-template-columns: 1fr;
    place-items: center;
    text-align: center;
    padding: 0;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)),
        rgba(248, 250, 252, 0.92);
}

.brand-card::after {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.90));
}

.brand-logo-area {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 18px 22px;
    transform: translateZ(18px);
}

.ic-logo {
    display: block;
    width: 90%;
    height: 90%;
    max-width: 420px;
    max-height: 120px;
    object-fit: contain;
    transform: scale(1.10);
    filter: drop-shadow(0 14px 24px rgba(15, 23, 42, 0.18));
}

.brand-note {
    display: none;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    color: rgba(248, 250, 252, 0.74);
    font-size: 0.78rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 8px rgba(52, 211, 153, 0.12);
}

@keyframes revealCard {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (min-width: 901px) {
    html,
    body {
        height: 100%;
        overflow-y: hidden;
    }

    .page-shell {
        height: 100svh;
        min-height: 0;
    }
}

@media (min-width: 901px) and (max-height: 720px) {
    .page-shell {
        width: min(1060px, calc(100% - 24px));
        padding: 8px 0 8px;
    }

    .hero {
        margin-bottom: 10px;
    }

    .eyebrow {
        padding: 4px 10px;
        font-size: 0.61rem;
    }

    h1 {
        font-size: clamp(1.68rem, 3.7vw, 2.85rem);
    }

    .subtitle {
        margin-top: 6px;
        font-size: 0.82rem;
    }

    .cards {
        gap: 10px;
    }

    .system-card {
        min-height: 140px;
        padding: 13px;
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 12px;
        border-radius: 20px;
    }

    .system-card::after {
        border-radius: 19px;
    }

    .icon-wrap {
        width: 58px;
        height: 58px;
        border-radius: 17px;
    }

    .icon-wrap svg {
        width: 36px;
        height: 36px;
    }

    .logo-wrap {
        height: 58px;
    }

    .card-title {
        font-size: 0.96rem;
        line-height: 1.16;
    }

    .card-content {
        gap: 6px;
    }

    .card-description {
        font-size: 0.73rem;
        line-height: 1.24;
    }

    .card-action {
        font-size: 0.78rem;
    }

    .brand-logo-area {
        padding: 13px 18px;
    }

    .ic-logo {
        width: 90%;
        height: 90%;
        max-height: 108px;
        transform: scale(1.12);
    }

    .footer {
        margin-top: 8px;
    }
}

@media (max-width: 1020px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .page-shell {
        padding: 28px 0 22px;
    }

    .system-card {
        min-height: 178px;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 22px, 540px);
        padding: 28px 0 22px;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .system-card {
        min-height: 168px;
        padding: 18px;
        border-radius: 24px;
        grid-template-columns: 62px minmax(0, 1fr);
    }

    .system-card::after {
        border-radius: 23px;
    }

    .icon-wrap {
        width: 62px;
        height: 62px;
        border-radius: 20px;
    }

    .icon-wrap svg {
        width: 38px;
        height: 38px;
    }

    .logo-wrap {
        width: 100%;
        height: 62px;
    }

    .brand-card {
        grid-template-columns: 1fr;
    }

    .brand-logo-area {
        padding: 16px 18px;
    }

    .ic-logo {
        width: 88%;
        height: 88%;
        max-height: 110px;
        transform: scale(1.04);
    }

    .footer {
        flex-wrap: wrap;
        text-align: center;
    }
}

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

    #siteCanvas {
        display: none;
    }
}
