/* ==========================================================================
   MAVIE STUDIO — DESIGN SYSTEM & ARCHITECTURAL STYLES
   Ultra-minimalist, Editorial Tech, High Contrast, Structural Grid
   ========================================================================== */

:root {
  --graphite: #161618;
  --graphite-card: #1c1c1f;
  --graphite-border: #27272a;
  --offwhite: #f4f4f5;
  --offwhite-card: #ffffff;
  --offwhite-border: #e4e4e7;
  --cobalt: #2563eb;
  --cobalt-hover: #1d4ed8;
  --cobalt-glow: rgba(37, 99, 235, 0.35);
  --structural-line: #27272a;
  --structural-light-line: rgba(0, 0, 0, 0.07);
  --text-muted-dark: #a1a1aa;
  --text-muted-light: #71717a;
  
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Base Styles */
html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--offwhite);
  color: var(--graphite);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  selection-background-color: var(--cobalt);
  selection-color: #ffffff;
  transition: background-color 0.4s var(--ease-out-expo), color 0.4s var(--ease-out-expo);
}

html.dark body {
  background-color: var(--graphite);
  color: var(--offwhite);
}

::selection {
  background-color: var(--cobalt);
  color: #ffffff;
}

/* Architectural Grid Textures */
.bg-grid-dark {
  background-color: var(--graphite);
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

.bg-grid-dense-dark {
  background-color: var(--graphite);
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 16px 16px, 16px 16px;
}

.bg-grid-light {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  transition: background-image 0.4s ease;
}

html.dark .bg-grid-light {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

.bg-blueprint-radial {
  background: radial-gradient(circle at 50% 30%, rgba(37, 99, 235, 0.08) 0%, transparent 65%);
}

/* Architectural Lines & Accents */
.structural-border {
  border-color: var(--structural-line);
}

.structural-border-light {
  border-color: var(--offwhite-border);
}

/* Chrome / Titanium Text Gradient (Editorial Tech vibe) */
.text-chrome {
  background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 50%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-chrome-dark {
  background: linear-gradient(135deg, #161618 0%, #52525b 50%, #161618 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Outlined Display Numbers */
.text-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(22, 22, 24, 0.35);
  font-family: var(--font-display);
}

.text-outline-dark,
html.dark .text-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 244, 245, 0.3);
  font-family: var(--font-display);
}

/* Typography Enhancements */
.font-display {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-body);
}

.font-mono {
  font-family: var(--font-mono);
}

.tracking-tightest {
  letter-spacing: -0.04em;
}

.tracking-tighter-editorial {
  letter-spacing: -0.03em;
}

/* Button & Interactive Hover States */
.btn-cobalt {
  background-color: var(--cobalt);
  color: #ffffff;
  transition: all 0.3s var(--ease-out-expo);
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.25);
}

.btn-cobalt:hover {
  background-color: var(--cobalt-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px 0 rgba(37, 99, 235, 0.38);
}

.btn-ghost-dark {
  background-color: transparent;
  color: var(--graphite);
  border: 1px solid var(--graphite);
  transition: all 0.3s var(--ease-out-expo);
}

.btn-ghost-dark:hover {
  background-color: var(--graphite);
  color: var(--offwhite);
  transform: translateY(-1px);
}

html.dark .btn-ghost-dark {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--offwhite);
  border: 1px solid rgba(244, 244, 245, 0.25);
}

html.dark .btn-ghost-dark:hover {
  background-color: rgba(244, 244, 245, 0.15);
  border-color: var(--offwhite);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-ghost-light {
  background-color: transparent;
  color: var(--offwhite);
  border: 1px solid rgba(244, 244, 245, 0.3);
  transition: all 0.3s var(--ease-out-expo);
}

.btn-ghost-light:hover {
  background-color: rgba(244, 244, 245, 0.1);
  border-color: var(--offwhite);
  transform: translateY(-1px);
}

/* Service Card Hover Precision */
.service-card {
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo), border-color 0.4s ease;
  will-change: transform;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.08);
  border-color: rgba(37, 99, 235, 0.4);
}

html.dark .service-card:hover {
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5);
  border-color: rgba(37, 99, 235, 0.55);
}

/* Process Step Hover (Editorial Interaction) */
.process-step {
  transition: opacity 0.5s var(--ease-out-expo), background-color 0.3s ease, padding 0.3s var(--ease-out-expo);
  border-radius: 2px;
}

.process-step:hover {
  background-color: rgba(0, 0, 0, 0.02);
  padding-left: 8px;
  padding-right: 8px;
}

html.dark .process-step:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.process-step:hover .text-outline {
  -webkit-text-stroke-color: var(--cobalt);
  color: rgba(37, 99, 235, 0.08);
}

/* Pulsing Beacon */
@keyframes beacon-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.beacon-pulse {
  animation: beacon-pulse 2s infinite;
}

/* Animated Timeline Connector */
@keyframes flow-line {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.timeline-flow-active {
  position: relative;
  overflow: hidden;
}

.timeline-flow-active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--cobalt), transparent);
  animation: flow-line 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
}

::-webkit-scrollbar-track {
  background: var(--offwhite);
}

html.dark ::-webkit-scrollbar-track {
  background: #161618;
}

::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1aa;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #27272a;
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* Subtle Cursor Indicator */
.custom-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transition: transform 0.15s ease-out, opacity 0.3s ease;
  transform: translate(-50%, -50%);
}

/* Modal Drawer Backdrop */
.modal-backdrop {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(22, 22, 24, 0.75);
}

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

/* ==========================================================================
   SIGNAL PARTICLES CANVAS & KINETIC SCROLL STYLES
   ========================================================================== */
#signal-particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2;
}

html.dark #signal-particles-canvas {
  filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.35));
}

html:not(.dark) #signal-particles-canvas {
  filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.25));
}

/* ==========================================================================
   GATEWAY DIVIDERS & SHOCKWAVE LASER BEAM (Option C)
   ========================================================================== */
.gateway-divider {
  position: relative;
}

.gateway-divider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: transparent;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: opacity 0.25s ease;
}

.gateway-divider.shockwave-beam::before {
  background: linear-gradient(90deg, transparent 0%, #2563eb 20%, #60a5fa 50%, #2563eb 80%, transparent 100%);
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.65), 0 0 24px rgba(96, 165, 250, 0.4);
  animation: gateway-shockwave-sweep 1.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

html.dark .gateway-divider.shockwave-beam::before {
  background: linear-gradient(90deg, transparent 0%, #3b82f6 15%, #ffffff 50%, #60a5fa 85%, transparent 100%);
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.8), 0 0 32px rgba(59, 130, 246, 0.5);
}

@keyframes gateway-shockwave-sweep {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  25% {
    transform: scaleX(0.7);
    opacity: 1;
  }
  60% {
    transform: scaleX(1);
    opacity: 0.9;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

/* ==========================================================================
   EDITORIAL TELEMETRY HUD (Indicador Lateral de Dobras · Rigor Suíço)
   ========================================================================== */
#editorial-hud {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hud-item {
  position: relative;
  outline: none;
  background: none;
  border: none;
  padding: 2px 0;
}

.hud-item .hud-label {
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-item .hud-pip {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-item.is-active .hud-label {
  opacity: 1 !important;
  color: var(--cobalt) !important;
  font-weight: 600;
  transform: translateX(-2px);
}

html.dark .hud-item.is-active .hud-label {
  color: #60a5fa !important;
}

.hud-item.is-active .hud-pip {
  background-color: var(--cobalt) !important;
  transform: scale(1.65);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.75);
}

html.dark .hud-item.is-active .hud-pip {
  background-color: #60a5fa !important;
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.9);
}

/* Supplied complete PNG identity — institutional branding only. */
.mavie-site-brand{display:inline-flex;align-items:center;min-height:48px;flex-shrink:0}
.mavie-site-brand-header img,.mavie-site-brand-image{display:block;width:144px;height:auto;max-width:100%}
html:not(.dark) #main-navbar .mavie-site-brand-header img{filter:brightness(0)}
@media(min-width:768px) and (max-width:1023px){
  .mavie-site-brand-header img{width:clamp(112px,calc(100vw - 656px),144px)}
}
@media(min-width:1024px){
  .mavie-site-brand-header img,.mavie-site-brand-footer .mavie-site-brand-image{width:180px}
}

/* =========================================================================
   PORTFÓLIO — DEMOS AO VIVO
   ========================================================================= */
.demo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; list-style: none; margin: 0; padding: 0; }
.demo-card__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; background: var(--offwhite-card); border: 1px solid var(--offwhite-border); border-radius: 4px; overflow: hidden; transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s cubic-bezier(.22,1,.36,1), border-color .3s; }
.demo-card__link:hover { transform: translateY(-6px); border-color: var(--cobalt); box-shadow: 0 30px 60px -32px rgba(22, 22, 24, .45); }
.demo-card__link:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.demo-card__shot { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--offwhite-border); border-bottom: 1px solid var(--offwhite-border); }
.demo-card__shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.1s cubic-bezier(.22,1,.36,1); }
.demo-card__link:hover .demo-card__shot img { transform: scale(1.04); }
.demo-card__body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 22px 22px 24px; }
.demo-card__cat { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--cobalt); font-weight: 600; }
.demo-card__name { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -.02em; color: var(--graphite); }
.demo-card__text { flex: 1; font-size: 15px; line-height: 1.6; color: var(--text-muted-light); }
.demo-card__cta { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--offwhite-border); font-weight: 600; font-size: 14.5px; color: var(--graphite); }
.demo-card__link:hover .demo-card__cta { color: var(--cobalt); }
.demo-note { margin-top: 28px; max-width: 70ch; font-size: 14px; line-height: 1.6; color: var(--text-muted-light); }
html.dark .demo-card__link { background: var(--graphite-card); border-color: var(--graphite-border); }
html.dark .demo-card__link:hover { border-color: var(--cobalt); }
html.dark .demo-card__shot { background: var(--graphite-border); border-color: var(--graphite-border); }
html.dark .demo-card__name, html.dark .demo-card__cta { color: #fff; }
html.dark .demo-card__text, html.dark .demo-note { color: var(--text-muted-dark); }
html.dark .demo-card__cta { border-color: var(--graphite-border); }
@media (max-width: 960px) { .demo-grid { grid-template-columns: 1fr; max-width: 560px; } }
@media (prefers-reduced-motion: reduce) { .demo-card__link, .demo-card__shot img { transition: none; } .demo-card__link:hover { transform: none; } }

/* Portfólio — mural de sites em movimento (duas fileiras em sentidos opostos) */
.wall { position: relative; width: 100vw; margin: 0 0 56px calc(50% - 50vw); padding: 8px 0; overflow: hidden; display: grid; gap: 22px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.wall__row { display: flex; gap: 22px; width: max-content; margin: 0; padding: 0; list-style: none; animation: wall-left 140s linear infinite; }
.wall__row--rev { animation-name: wall-right; animation-duration: 160s; }
.wall:hover .wall__row, .wall:focus-within .wall__row { animation-play-state: paused; }
@keyframes wall-left { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 11px)); } }
@keyframes wall-right { from { transform: translateX(calc(-50% - 11px)); } to { transform: translateX(0); } }
.wall__item { flex: none; width: clamp(220px, 24vw, 340px); }
.wall__tile { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; padding: 6px; background: #232326; border: 1px solid #2f2f33; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55); transition: transform .5s cubic-bezier(.22,1,.36,1), border-color .3s; }
.wall__tile img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 9px; background: #e4e4e7; }
.wall__tile:hover { transform: translateY(-6px); border-color: var(--cobalt); }
.wall__tile:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.wall__label { position: absolute; left: 14px; bottom: 14px; padding: 6px 11px; border-radius: 999px; background: rgba(22, 22, 24, .82); color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.wall__tile:hover .wall__label, .wall__tile:focus-visible .wall__label { opacity: 1; transform: none; }
html:not(.dark) .wall__tile { background: #fff; border-color: var(--offwhite-border); box-shadow: 0 30px 60px -34px rgba(22, 22, 24, .35); }
@media (max-width: 640px) { .wall { gap: 14px; margin-bottom: 40px; } .wall__row { gap: 14px; } .wall__item { width: 200px; } .wall__label { opacity: 1; transform: none; font-size: 11px; } @keyframes wall-left { to { transform: translateX(calc(-50% - 7px)); } } @keyframes wall-right { from { transform: translateX(calc(-50% - 7px)); } } }
@media (prefers-reduced-motion: reduce) { .wall__row { animation: none; } .wall { overflow-x: auto; -webkit-mask-image: none; mask-image: none; } .wall__item[aria-hidden="true"] { display: none; } }
/* Portfólio: menos espaço no topo (o Processo acima já fecha com respiro grande) */
#portfolio { padding-top: 56px; }
@media (min-width: 768px) { #portfolio { padding-top: 72px; } }
#processo { padding-bottom: 56px; }
@media (min-width: 768px) { #processo { padding-bottom: 72px; } }

/* Portfólio: chamada "no ar" acima dos cartões das demos */
.demo-live { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; font-size: 16px; line-height: 1.55; color: var(--text-muted-light); }
.demo-live p { margin: 0; }
.demo-live strong { color: var(--graphite); font-weight: 600; }
.demo-live__dot { position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); }
html.dark .demo-live { color: var(--text-muted-dark); }
html.dark .demo-live strong { color: #fff; }
