/* Identidade, navegação e componentes compartilhados do site. */

@font-face {
    font-family: "Instrument Sans";
    src: url("/assets/fonts/instrument-sans.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #070d19;
    --ink: #f0f5ff;
    --muted: #a3b3cc;
    --accent: #91c7ff;
    --accent-hover: #c1dfff;
    --line: #91b5e33b;
    --radius: 20px;
    --radius-card: 18px;
    --content-width: 1280px;
    --gutter: 42px;
    --panel: linear-gradient(135deg, #1d304a 0%, #101d32 58%, #0d1729 100%);
    --shadow: 0 20px 40px #02071166, inset 0 1px #d5e8ff18;
    font-family: "Instrument Sans", Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 124px; }
body { margin: 0; background: radial-gradient(ellipse at 100% 0, #16336555, transparent 900px), var(--bg); color: var(--ink); line-height: 1.55; }
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
figure, h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #87cbff; outline-offset: 4px; }
::selection { background: #376cc9; color: #fff; }

.wrap { width: min(var(--content-width), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 10;
    transform: translateY(-150%);
    padding: 12px 20px;
    background: #e9f3ff;
    color: #0a1a30;
    border-radius: 8px;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
    position: sticky;
    top: 14px;
    z-index: 20;
    width: min(1340px, calc(100% - 36px));
    margin: 14px auto 0;
    border: 1px solid #a7c9ff3d;
    border-radius: 16px 5px 16px 5px;
    background: linear-gradient(110deg, #1a2940f2, #0c1729f2 70%);
    box-shadow: 0 14px 35px #0005, inset 0 1px #e2edff1a;
    backdrop-filter: blur(18px);
}
.site-header::before {
    content: "";
    position: absolute;
    inset: -1px 17% auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, #abd9ff99, transparent);
    pointer-events: none;
}
.header-layout {
    min-height: 76px;
    width: calc(100% - 42px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-block: 9px;
}
.brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
}
.brand-logo { width: 132px; height: auto; }
.site-header nav { display: flex; align-items: center; gap: clamp(6px, 1.5vw, 20px); }
.site-header nav > a, .nav-solutions > summary { padding-inline: 8px; }
.site-header nav a { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; color: var(--muted); font-size: 14px; font-weight: 640; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--accent); }
.site-header nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }
.site-header nav .header-contact {
    padding: 8px 18px;
    border: 1px solid #8bb8ff88;
    border-radius: 10px 3px 10px 3px;
    color: #fff;
    background: linear-gradient(130deg, #467ee6, #244fb6);
    box-shadow: inset 0 1px #d3e7ff66, 0 4px 0 #142d63, 0 7px 20px #1c60d436;
}
.site-header nav .header-contact:hover { color: #fff; background: linear-gradient(130deg, #629aff, #315ed2); }
.menu-toggle { display: none; }

.nav-solutions > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #cbdaf0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 640;
    list-style: none;
    transition: background-color .2s, border-color .2s;
}
.nav-solutions > summary::-webkit-details-marker { display: none; }
.nav-solutions > summary:hover,
.nav-solutions[open] > summary { background: #a4caff10; border-color: #9dc7ff36; color: #fff; }
.nav-chevron {
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s;
}
.nav-solutions[open] .nav-chevron { transform: translateY(3px) rotate(225deg); }
.mega-menu {
    position: absolute;
    top: calc(100% + 11px);
    right: -1px;
    left: -1px;
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    padding: 24px;
    gap: 24px;
    border: 1px solid #85b3f063;
    border-radius: 18px 6px 18px 6px;
    background: linear-gradient(115deg, #172b46, #0c192d 80%);
    box-shadow: 0 30px 70px #0009, inset 0 1px #d7eaff29;
    animation: mega-enter .2s ease-out;
}
@keyframes mega-enter {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.mega-solutions { display: grid; gap: 6px; }
.site-header .mega-menu .mega-solution {
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr) 20px;
    gap: 14px;
    padding: 13px;
    border: 1px solid transparent;
    border-radius: 12px 4px 12px 4px;
    transition: background-color .2s, border-color .2s, transform .2s;
    text-decoration: none;
}
.site-header .mega-menu .mega-solution:hover,
.site-header .mega-menu .mega-solution[aria-current] { background: #89b9ff10; border-color: #8ab5ef48; transform: translateX(3px); }
.mega-icon {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    border: 1px solid #9bc6ff40;
    border-radius: 11px 4px 11px 4px;
    color: #aad9ff;
    background: linear-gradient(145deg, #344f77, #172b49);
    box-shadow: inset 0 1px #d5eaff20, 0 7px 15px #0003;
    font-size: 25px;
}
.mega-solution strong { display: block; color: #f0f6ff; font-size: 17px; font-weight: 650; }
.mega-solution small { display: block; margin-top: 3px; color: #aebfd8; font-size: 13px; font-weight: 400; }
.mega-arrow { color: #8dc8ff; font-size: 19px; }
.mega-discover { display: flex; flex-direction: column; align-items: stretch; gap: 9px; padding: 20px 24px; border-left: 1px solid #90b6e535; }
.mega-discover p { max-width: 20ch; margin-bottom: 7px; color: #f0f6ff; font-size: clamp(20px, 2.3vw, 28px); font-weight: 600; letter-spacing: -.035em; line-height: 1.2; }
.site-header .mega-discover .button { justify-content: space-between; color: var(--ink); text-align: left; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; margin-top: 26px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 670;
    position: relative;
    overflow: hidden;
    min-height: 51px;
    padding: 12px 21px;
    border: 1px solid transparent;
    border-radius: 12px 4px 12px 4px;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.button-primary {
    color: #fff;
    border-color: #8abbffa6;
    background: linear-gradient(135deg, #578ff1 0%, #2c64da 45%, #1948b1 100%);
    box-shadow: inset 0 1px #e4f1ff80, inset 0 -2px #183d8d80, 0 4px 0 #102756, 0 10px 32px #3479f547;
}
.button-primary:hover { color: #fff; border-color: #badfff; background: linear-gradient(135deg, #65a4ff, #336be5 60%, #2655c1); box-shadow: inset 0 1px #eaf5ff88, 0 4px 0 #142a61, 0 12px 35px #2778f563; transform: translateY(-2px); }
.button::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 20%, #ffffff20 48%, transparent 75%); transform: translateX(-120%); transition: transform .6s ease; }
.button:hover::after { transform: translateX(120%); }
.button:active { transform: translateY(2px); }
.button-contact { color: #13264c; border-color: #e2eeff; background: linear-gradient(135deg, #fff, #abc5ec); box-shadow: inset 0 1px #fff, 0 4px 0 #627fa9, 0 12px 28px #0004; }
.button-contact:hover { background: linear-gradient(135deg, #fff, #d3e4ff); transform: translateY(-2px); }
.button-secondary { background: linear-gradient(135deg, #22324b, #111b2d); border-color: #b6cfff45; color: var(--ink); box-shadow: inset 0 1px #d4e7ff13, 0 4px 0 #070d18, 0 9px 20px #0004; }
.button-secondary:hover { background: linear-gradient(135deg, #2d4262, #192942); border-color: #89b6fc; transform: translateY(-2px); }
.button-compact {
    max-width: 100%;
    min-height: 44px;
    padding: 8px 13px;
    font-size: 13px;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
}

.section { padding-block: clamp(49px, 6vw, 84px); }
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px 26px;
    margin-bottom: 23px;
}
h2 { font-size: clamp(29px, 4vw, 54px); font-weight: 665; letter-spacing: -.041em; line-height: 1.08; }
.eyebrow { color: #a5c8f5; font-family: Consolas, "Courier New", monospace; font-size: 11px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; }
.section-eyebrow { margin-bottom: 19px; }
.text-metal { color: #a7c9f5; background: linear-gradient(105deg, #e1edff, #79a8e7 70%, #4078c8); background-clip: text; -webkit-text-fill-color: transparent; }
.panel, .project-card, dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.project-media {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    aspect-ratio: 1.72;
    overflow: hidden;
    padding: 15px;
    border: 1px solid #b0ceff30;
    border-radius: 11px;
    background: radial-gradient(ellipse at 0 0, #3a5a81, transparent 90%), #142139;
}
.media-violet { background: linear-gradient(135deg, #3e4562, #1c2338); }
.media-mint { background: linear-gradient(135deg, #2c5159, #142933); }
.media-amber { background: linear-gradient(135deg, #54443a, #272432); }
.project-image-link {
    display: grid;
    place-items: center;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    width: 100%;
    height: 100%;
}
.project-image-link:focus-visible { outline-offset: 2px; }
.project-media img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    border-radius: 5px;
    box-shadow: 0 9px 20px #1c30452c, 0 0 0 1px #23355516;
    transition: transform .22s ease;
}
.category { color: var(--accent); font-size: 13px; font-weight: 665; }
.arrow-link {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 43px;
    height: 43px;
    border: 1px solid #9ec4ff55;
    border-radius: 11px 4px 11px 4px;
    background: linear-gradient(145deg, #354e73, #15243c);
    color: #c5e1ff;
    box-shadow: inset 0 1px #ffffff1f, 0 5px 12px #0004;
    font-size: 19px;
    line-height: 1;
    transition: background-color .18s ease, border-color .18s ease;
}
.arrow-link:hover { border-color: #a0b8e7; background: #315a91; }
.filters {
    display: none;
    flex-wrap: wrap;
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #08101d;
    box-shadow: inset 0 2px 8px #0004;
}
.portfolio-ready .filters { display: flex; }
.filters button {
    min-height: 39px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 620;
}
.filters button:hover { color: var(--accent); border-color: var(--line); }
.filters button[aria-pressed="true"] { background: linear-gradient(145deg, #304f7e, #1c3151); border-color: #608bc566; color: #fff; box-shadow: inset 0 1px #ffffff1f, 0 2px 5px #0005; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-card { position: relative; min-width: 0; padding: 10px; border-radius: var(--radius-card) 6px var(--radius-card) 6px; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.project-card::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 27px; height: 27px; border-right: 1px solid #709ad96b; border-bottom: 1px solid #709ad96b; border-radius: 0 0 var(--radius-card) 0; pointer-events: none; }
.project-card:focus-within { border-color: #8ba6db; }
.project-caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; padding: 13px 9px 10px; }
.project-caption h3 { margin-top: 3px; font-size: clamp(20px, 2vw, 26px); font-weight: 680; line-height: 1.14; letter-spacing: -.033em; }
.project-description { margin-top: 7px; color: var(--muted); font-size: 15px; }
.project-open { display: none; }
.portfolio-ready .project-open { display: inline-grid; }
@media (hover: hover) {
    .project-card:hover { transform: translateY(-5px); border-color: #85b7ff88; box-shadow: 0 24px 38px #0006, 0 0 27px #236ee71a, inset 0 1px #bbd7ff33; }
    .project-card:hover .project-media img { transform: scale(1.02); }
}

.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 17px; padding-block: 22px 26px; border-top: 1px solid var(--line); }
.site-footer .brand-logo { width: 120px; }
.site-footer > small { color: var(--muted); text-align: right; line-height: 1.4; }
.footer-cnpj { white-space: nowrap; }

dialog {
    width: min(535px, calc(100% - 28px));
    max-height: calc(100% - 28px);
    overflow: auto;
    padding: 31px;
    color: var(--ink);
    border-color: #b5c8e9;
    box-shadow: 0 22px 66px #09162c44;
}
dialog::backdrop { background: #14223ea0; backdrop-filter: blur(4px); }
.dialog-close { position: absolute; right: 12px; top: 11px; width: 44px; height: 44px; border: 1px solid transparent; border-radius: 9px; background: transparent; font-size: 25px; }
.dialog-close:hover { background: #233650; border-color: var(--line); }
dialog h2 { margin: 5px 28px 13px 0; font-size: clamp(28px, 5vw, 40px); }
dialog ul { margin-block: 17px 22px; padding-left: 20px; }
dialog li + li { margin-top: 4px; }
.dialog-preview { width: 100%; max-height: 240px; object-fit: contain; margin: 4px 0 16px; border: 1px solid var(--line); border-radius: 10px; background: #101c30; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.internal-page { display: flex; flex-direction: column; min-height: 100vh; }
.internal-page > main { flex: 1; }
.page-heading { margin-bottom: 29px; }
.page-heading h1 { font-size: clamp(37px, 6vw, 72px); font-weight: 665; letter-spacing: -.055em; line-height: 1.04; }
.page-heading .category { margin-bottom: 8px; }
.lead { max-width: 64ch; margin-top: 13px; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }
.content-panel { padding: clamp(19px, 4vw, 42px); }

/* O painel administrativo tem sua própria superfície escura. */
body:has(.admin-shell, .admin-auth) {
    color-scheme: dark;
    --ink: #f4f7ff;
    --muted: #b5c2d6;
    --line: #88afe63b;
    --accent: #a1c9ff;
    --panel: #111d30;
    color: var(--ink);
}
body:has(.admin-shell, .admin-auth) .button-secondary { color: var(--ink); background: #1a2940; border-color: #6b91cb61; }
body:has(.admin-shell, .admin-auth) .button-secondary:hover { background: #263d5e; border-color: #a1c9ff; }

@media (max-width: 1100px) { :root { --gutter: 29px; } }
@media (max-width: 850px) {
    :root { --gutter: 20px; }
    html { scroll-padding-top: 110px; }
    .header-layout { min-height: 66px; flex-wrap: wrap; gap: 6px 13px; padding-block: 8px; }
    .site-header .brand-logo { width: 108px; }
    .site-header nav {
        flex: 1 1 100%;
        flex-wrap: wrap;
        gap: 3px 9px;
        padding-block: 8px 12px;
        max-height: calc(100dvh - 108px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .nav-solutions { flex: 1 1 100%; }
    .nav-solutions > summary { justify-content: space-between; padding-inline: 12px; }
    .mega-menu { position: static; grid-template-columns: 1fr; gap: 10px; margin-block: 7px; padding: 9px; border-radius: 12px; box-shadow: inset 0 1px #d7eaff15; }
    .site-header .mega-menu .mega-solution { padding: 10px; gap: 10px; }
    .mega-discover { padding: 17px 12px 10px; border-left: 0; border-top: 1px solid #90b6e535; }
    .mega-discover p { max-width: none; font-size: 20px; }
    .js .site-header nav:not(.is-open) { display: none; }
    .js .menu-toggle {
        display: grid;
        place-content: center;
        gap: 6px;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 9px;
        background: linear-gradient(140deg, #283e60, #101e33);
    }
    .menu-toggle span { width: 18px; height: 1px; background: var(--ink); }
    .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
    .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
    .section-heading { align-items: flex-start; flex-direction: column; margin-bottom: 17px; }
    .actions { margin-top: 21px; }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    :root { --gutter: 15px; }
    .site-header { top: 8px; width: calc(100% - 20px); margin-top: 8px; border-radius: 14px 5px 14px 5px; }
    .header-layout { width: calc(100% - 26px); }
    .project-grid { grid-template-columns: 1fr; gap: 11px; }
    .project-media { aspect-ratio: 1.75; }
    .site-footer { flex-direction: column; align-items: flex-start; gap: 12px; }
    .site-footer > small { text-align: left; }
    dialog { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .project-card:hover, .project-card:hover .project-media img, .button:hover { transform: none; }
    .site-header .mega-menu .mega-solution:hover { transform: none; }
}
