/* ==========================================================================
   CAMADA VISUAL AVANCADA (fx) - light mode, apenas transform/opacity animados
   ========================================================================== */
:root {
    --fx-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --fx-accent: #059669;
}

/* Fundo: grade pontilhada com mascara radial */
html.fx body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(rgba(9, 9, 11, 0.09) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 10%, transparent 80%);
    mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 10%, transparent 80%);
}

/* Granulado fino sobre toda a pagina */
html.fx body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Barra de progresso de leitura */
.fx-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 120;
    background: linear-gradient(90deg, var(--fx-accent), #0ea5e9);
    transform: scaleX(0);
    transform-origin: 0 50%;
}

/* Aurora ambiente: fixa na janela, acompanha a rolagem, o mouse e a secao atual */
@property --c1 { syntax: "<color>"; inherits: true; initial-value: #a7f3d0; }
@property --c2 { syntax: "<color>"; inherits: true; initial-value: #bae6fd; }
@property --c3 { syntax: "<color>"; inherits: true; initial-value: #e9d5ff; }
#hero {
    position: relative;
    isolation: isolate;
}
.fx-aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    transition: --c1 1.6s ease, --c2 1.6s ease, --c3 1.6s ease;
}
html { overflow-x: clip; background: #fff; }
html.fx body { background: transparent !important; }
.fx-aurora i {
    position: absolute;
    display: block;
    border-radius: 9999px;
    filter: blur(80px);
    opacity: 0.5;
    will-change: transform, translate;
}
.fx-aurora i:nth-child(1) {
    width: 34rem; height: 34rem; left: -4%; top: 4%; background: var(--c1);
    translate: calc(var(--px, 0px) * 1) calc(var(--py, 0px) * 1 + var(--sy, 0px) * -0.35);
    animation: fxFloatA 22s ease-in-out infinite alternate;
}
.fx-aurora i:nth-child(2) {
    width: 30rem; height: 30rem; left: 38%; top: -8%; background: var(--c2);
    translate: calc(var(--px, 0px) * -0.7) calc(var(--py, 0px) * -0.7 + var(--sy, 0px) * -0.2);
    animation: fxFloatB 26s ease-in-out infinite alternate;
}
.fx-aurora i:nth-child(3) {
    width: 28rem; height: 28rem; right: -4%; top: 30%; background: var(--c3);
    translate: calc(var(--px, 0px) * 0.5) calc(var(--py, 0px) * 0.5 + var(--sy, 0px) * -0.5);
    animation: fxFloatA 30s ease-in-out infinite alternate-reverse;
}
@keyframes fxFloatA { to { transform: translate3d(5rem, 3rem, 0) scale(1.15); } }
@keyframes fxFloatB { to { transform: translate3d(-6rem, 4rem, 0) scale(0.9); } }

/* Titulo com revelacao por palavra */
#hero h1 { letter-spacing: -0.035em; }
.fx-word {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding-bottom: 0.1em;
    margin-bottom: -0.1em;
}
.fx-word > span {
    display: inline-block;
    transform: translate3d(0, 110%, 0);
    transition: transform 0.9s var(--fx-ease);
    transition-delay: calc(var(--i) * 60ms);
}
html.fx-ready .fx-word > span { transform: none; }
.fx-grad > span {
    background: linear-gradient(100deg, #09090b 0%, #059669 55%, #0284c7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Reveal ao rolar */
html.fx [data-fx] {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition: opacity 0.8s var(--fx-ease), transform 0.8s var(--fx-ease);
    transition-delay: calc(var(--d, 0) * 70ms);
}
html.fx [data-fx].is-in {
    opacity: 1;
    transform: none;
}

/* Cards: spotlight que segue o cursor e borda viva */
.editorial-card {
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.35s var(--fx-ease), transform 0.35s var(--fx-ease);
}
.editorial-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(5, 150, 105, 0.1), transparent 60%);
}
.editorial-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(5, 150, 105, 0.65), transparent 65%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
.editorial-card:hover::before,
.editorial-card:hover::after { opacity: 1; }
.editorial-card:hover { box-shadow: 0 18px 40px -22px rgba(9, 9, 11, 0.28); }
.editorial-card > * { position: relative; z-index: 1; }
.editorial-card[data-tilt] { transform-style: preserve-3d; will-change: transform; }

/* Faixa tecnologica (marquee) */
.fx-marquee {
    margin-top: 3rem;
    overflow: hidden;
    border-block: 1px solid var(--border-subtle);
    padding: 0.9rem 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.fx-marquee-track {
    display: flex;
    width: max-content;
    animation: fxMarquee 38s linear infinite;
}
.fx-marquee:hover .fx-marquee-track { animation-play-state: paused; }
.fx-marquee-track span {
    font: 500 0.78rem "JetBrains Mono", monospace;
    color: #71717a;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.fx-marquee-track span::after {
    content: "";
    width: 5px;
    height: 5px;
    margin: 0 1.25rem;
    border-radius: 9999px;
    background: #d4d4d8;
}
@keyframes fxMarquee { to { transform: translate3d(-50%, 0, 0); } }

/* Navegacao: indicador do item ativo e header ao rolar */
nav.hidden a[href^="#"] { position: relative; }
nav.hidden a[href^="#"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    border-radius: 2px;
    background: var(--fx-accent);
    transform: scaleX(0);
    transition: transform 0.35s var(--fx-ease);
}
nav.hidden a.is-active { color: #09090b; }
nav.hidden a.is-active::after { transform: scaleX(1); }
.editorial-header { transition: box-shadow 0.3s, background-color 0.3s; }
.editorial-header.is-scrolled { box-shadow: 0 10px 30px -24px rgba(9, 9, 11, 0.5); }

/* Feedback tatil em botoes */
a[class*="rounded-md"],
button[class*="rounded-md"] {
    transition: transform 0.25s var(--fx-ease), background-color 0.15s, border-color 0.15s;
}
a[class*="rounded-md"]:active,
button[class*="rounded-md"]:active { transform: scale(0.97); }

/* Paleta de comandos (Ctrl/Cmd + K) */
.fx-kbd {
    font: 600 0.65rem "JetBrains Mono", monospace;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.3rem;
    background: #fafafa;
    color: #52525b;
}
.fx-cmd-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    background: #fff;
    color: #52525b;
    font-size: 0.7rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.fx-cmd-btn:hover { border-color: var(--border-medium); color: #09090b; }
@media (min-width: 1100px) { .fx-cmd-btn { display: inline-flex; } }
.fx-cmd-btn, .fx-kbd { white-space: nowrap; }
.fx-cmd-overlay {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 14vh 1rem 1rem;
    background: rgba(9, 9, 11, 0.35);
    backdrop-filter: blur(6px);
}
.fx-cmd-overlay.is-open { display: flex; }
.fx-cmd {
    width: 100%;
    max-width: 34rem;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    box-shadow: 0 30px 80px -20px rgba(9, 9, 11, 0.45);
    overflow: hidden;
    animation: fxPop 0.35s var(--fx-ease);
}
@keyframes fxPop { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.98); } }
.fx-cmd input {
    width: 100%;
    border: 0;
    outline: 0;
    padding: 1rem 1.1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
}
.fx-cmd ul { list-style: none; margin: 0; padding: 0.4rem; max-height: 18rem; overflow-y: auto; }
.fx-cmd li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.7rem;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    color: #27272a;
    cursor: pointer;
}
.fx-cmd li small { margin-left: auto; font: 500 0.65rem "JetBrains Mono", monospace; color: #a1a1aa; }
.fx-cmd li[aria-selected="true"] { background: #f4f4f5; color: #09090b; }
.fx-cmd li svg { width: 16px; height: 16px; color: #52525b; }
.fx-cmd-empty { padding: 1.2rem; text-align: center; font-size: 0.8rem; color: #71717a; }

@media (prefers-reduced-motion: reduce) {
    html.fx [data-fx],
    .fx-word > span { opacity: 1 !important; transform: none !important; }
    .fx-aurora i,
    .fx-marquee-track { animation: none !important; }
}

/* ==========================================================================
   Secoes: projeto, trajetoria, principios e contato
   ========================================================================== */

/* Ilustracao do PDV (MXpack) */
.mx-device {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 30px 60px -40px rgba(9, 9, 11, 0.45);
    transform: rotate(1.2deg);
    transition: transform 0.6s var(--fx-ease);
}
.mx-showcase:hover .mx-device { transform: rotate(0deg) translate3d(0, -4px, 0); }
.mx-device::before {
    content: "";
    position: absolute;
    inset: -30% -20% auto auto;
    width: 70%;
    height: 70%;
    border-radius: 9999px;
    background: radial-gradient(closest-side, rgba(5, 150, 105, 0.18), transparent);
    pointer-events: none;
}
.mx-device-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border-subtle);
    background: #fafafa;
}
.mx-device-bar span { width: 9px; height: 9px; border-radius: 9999px; background: #e4e4e7; }
.mx-device-bar span:nth-child(1) { background: #fca5a5; }
.mx-device-bar span:nth-child(2) { background: #fcd34d; }
.mx-device-bar span:nth-child(3) { background: #6ee7b7; }
.mx-device-bar small { margin-left: auto; font: 500 0.65rem "JetBrains Mono", monospace; color: #a1a1aa; }
.mx-device-body { display: flex; flex-direction: column; gap: 0.55rem; padding: 1.1rem; flex: 1; }
.mx-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.9rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid #f4f4f5;
    border-radius: 0.55rem;
    font: 500 0.72rem "JetBrains Mono", monospace;
    color: #52525b;
    animation: mxIn 0.8s var(--fx-ease) both;
}
.mx-row:nth-child(2) { animation-delay: 0.1s; }
.mx-row:nth-child(3) { animation-delay: 0.2s; }
.mx-row b { color: #09090b; font-weight: 600; min-width: 4.5rem; text-align: right; }
@keyframes mxIn { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
.mx-sync {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
    font: 500 0.65rem "JetBrains Mono", monospace;
    color: #047857;
}
.mx-sync span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.55rem;
    border-radius: 9999px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}
.mx-sync i { width: 6px; height: 6px; border-radius: 9999px; background: #059669; animation: mxPulse 2s ease-in-out infinite; }
.mx-sync em { margin-left: auto; font-style: normal; color: #a1a1aa; }
@keyframes mxPulse { 50% { transform: scale(1.6); opacity: 0.45; } }
.mx-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--border-medium);
    font: 600 0.8rem "JetBrains Mono", monospace;
    color: #52525b;
}
.mx-total b { font-size: 1.4rem; color: #09090b; letter-spacing: -0.03em; }
.mx-pay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.6rem;
    background: #09090b;
    color: #fff;
    font: 600 0.75rem "JetBrains Mono", monospace;
}

/* Trajetoria: linha do tempo com no luminoso */
#trajetoria .editorial-timeline-item { position: relative; padding-left: 1.75rem; }
#trajetoria .editorial-timeline-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: #fff;
    border: 2px solid #09090b;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
    z-index: 1;
}
#trajetoria .editorial-timeline-item:first-child::before { background: #059669; border-color: #059669; animation: mxPulseRing 2.4s ease-out infinite; }
@keyframes mxPulseRing { 70% { box-shadow: 0 0 0 9px rgba(5, 150, 105, 0); } 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); } }

/* Principios: numeral grande e filete de destaque */
#principios .editorial-card { padding-top: 1.75rem; }
#principios .editorial-card > span:first-child { color: #059669; letter-spacing: 0.08em; }
#principios .editorial-card::selection { background: #0f172a; }
#principios .editorial-card h3 { font-size: 1rem; letter-spacing: -0.01em; }
#principios .editorial-card > span:first-child::after {
    content: "";
    display: block;
    width: 1.75rem;
    height: 2px;
    margin-top: 0.6rem;
    background: #09090b;
    transform-origin: 0 50%;
    transition: transform 0.5s var(--fx-ease), background-color 0.3s;
}
#principios .editorial-card:hover > span:first-child::after { transform: scaleX(2.2); background: #059669; }

/* Contato: bloco de chamada com brilho */
#contato .editorial-card {
    max-width: 44rem;
    background:
        radial-gradient(60% 90% at 15% 0%, rgba(167, 243, 208, 0.45), transparent 70%),
        radial-gradient(55% 80% at 90% 10%, rgba(186, 230, 253, 0.45), transparent 70%),
        #fff;
}
#contato h2 { letter-spacing: -0.035em; font-size: clamp(1.7rem, 4vw, 2.4rem); }

@media (prefers-reduced-motion: reduce) {
    .mx-device { transform: none !important; }
    .mx-row, .mx-sync i, #trajetoria .editorial-timeline-item::before { animation: none !important; }
}
