/* ==========================================================================
   CodinTop — layout 2026
   Paleta da marca: ardósia (#36404b) + vinho (#7c3434)
   ========================================================================== */

:root {
  --bg: #f6f4f1;
  --bg-elev: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f0ede8;
  --ink: #1b2129;
  --text: #3b444f;
  --muted: #5d6671;
  --border: #e3dfd8;
  --border-strong: #cfc9c0;
  --slate: #36404b;
  --accent: #8a2f2f;
  --accent-strong: #8a2f2f;
  --accent-soft: rgba(138, 47, 47, .09);
  --accent-glow: rgba(138, 47, 47, .18);
  --on-accent: #ffffff;
  --success: #1f7a4d;
  --danger: #b42318;
  --shadow-sm: 0 1px 2px rgba(27, 33, 41, .06), 0 2px 8px rgba(27, 33, 41, .04);
  --shadow-md: 0 10px 30px -12px rgba(27, 33, 41, .18);
  --shadow-lg: 0 30px 60px -24px rgba(27, 33, 41, .28);
  --grid-line: rgba(54, 64, 75, .07);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 72px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-fast: 160ms;
  --dur: 280ms;
  --dur-slow: 520ms;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0d1015;
  --bg-elev: #11151b;
  --surface: #151a21;
  --surface-2: #1b212a;
  --ink: #f3f0ea;
  --text: #c8ccd2;
  --muted: #979ea8;
  --border: #252c36;
  --border-strong: #343d49;
  --slate: #aab4c0;
  --accent: #ef9184;
  --accent-strong: #b5453b;
  --accent-soft: rgba(239, 145, 132, .1);
  --accent-glow: rgba(181, 69, 59, .28);
  --success: #5fd39a;
  --danger: #ff8b80;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 14px 34px -14px rgba(0, 0, 0, .55);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, .7);
  --grid-line: rgba(170, 180, 192, .06);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0; line-height: 1.12; letter-spacing: -.02em; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
html[data-theme="dark"] ::selection { background: var(--accent-strong); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 1000;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus { transform: none; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
  pointer-events: none;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background-color var(--dur) ease, border-color var(--dur) ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 34px; width: auto; transition: filter var(--dur) ease; }
html[data-theme="dark"] .brand img,
html[data-theme="dark"] .footer-brand img { filter: invert(1) hue-rotate(180deg) brightness(1.05); }

.nav { display: flex; align-items: center; gap: 6px; }
.nav-links { display: flex; align-items: center; gap: 2px; position: relative; }
.nav-links a {
  position: relative; display: inline-flex; align-items: center;
  padding: 8px 14px; border-radius: 999px;
  font-size: .925rem; font-weight: 500; color: var(--muted);
  transition: color var(--dur-fast) ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--ink); }
.nav-indicator {
  position: absolute; left: 0; top: 50%; height: 36px; margin-top: -18px;
  border-radius: 999px; background: var(--surface-2);
  width: var(--w, 0); transform: translateX(var(--x, 0));
  opacity: var(--o, 0);
  transition: transform 300ms var(--ease-out), width 300ms var(--ease-out), opacity var(--dur) ease;
  z-index: -1; pointer-events: none;
}
.site-header:not(.is-scrolled) .nav-indicator { background: color-mix(in srgb, var(--ink) 7%, transparent); }

.nav-tools { display: flex; align-items: center; gap: 10px; margin-left: 14px; padding-left: 16px; border-left: 1px solid var(--border); }

.lang-switch {
  position: relative; display: inline-flex; padding: 3px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.lang-switch a {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 11px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: var(--muted);
  transition: color var(--dur) ease;
}
.lang-switch a img { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.lang-switch a.is-active { color: var(--ink); }
.lang-switch::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; width: calc(50% - 3px);
  left: 3px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out);
}
.lang-switch[data-active="en"]::before { transform: translateX(100%); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); cursor: pointer; font-size: 1.05rem;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn i { display: inline-block; transition: transform 280ms var(--ease-out); }
.theme-toggle.is-spinning i { transform: rotate(180deg); }

.menu-toggle { display: none; }
.menu-toggle .bars { position: relative; width: 18px; height: 12px; }
.menu-toggle .bars span {
  position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur-fast) ease;
}
.menu-toggle .bars span:nth-child(1) { top: 0; }
.menu-toggle .bars span:nth-child(2) { top: 5px; }
.menu-toggle .bars span:nth-child(3) { top: 10px; }
.menu-open .menu-toggle .bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-open .menu-toggle .bars span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle .bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: fixed; top: calc(var(--header-h) + 8px); right: var(--gutter); left: var(--gutter);
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 12px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    transform-origin: top right;
    opacity: 0; transform: translateY(-8px) scale(.96); visibility: hidden;
    transition: opacity 150ms ease, transform 170ms var(--ease-out), visibility 0s linear 170ms;
  }
  .menu-open .nav { opacity: 1; transform: none; visibility: visible; transition: opacity 200ms ease, transform 240ms var(--ease-out), visibility 0s; }
  .nav-links { flex-direction: column; align-items: stretch; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; border-radius: var(--radius-sm); }
  .nav-links a.is-active { background: var(--surface-2); }
  .nav-indicator { display: none; }
  .nav-tools { margin: 0; padding: 10px 4px 2px; border-left: 0; border-top: 1px solid var(--border); justify-content: space-between; }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--border-strong);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-weight: 600; font-size: .975rem; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) ease, background-color var(--dur) ease, border-color var(--dur) ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn i { transition: transform var(--dur) var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn-primary { --btn-bg: var(--accent-strong); --btn-fg: var(--on-accent); --btn-bd: transparent; box-shadow: 0 10px 24px -10px var(--accent-glow); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(-120%);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { box-shadow: 0 16px 34px -12px var(--accent-glow); transform: translateY(-1px); }
  .btn-primary:hover::after { transform: translateX(120%); transition: transform 800ms var(--ease-out); }
  .btn-ghost:hover { --btn-bd: var(--ink); }
  .btn:hover i.bi-arrow-right, .btn:hover i.bi-arrow-up-right { transform: translateX(3px); }
  .why-item:hover::after { transform: scaleX(1); }
  .why-item:hover .ico { background: var(--accent-strong); color: #fff; border-color: transparent; }
  .contact-list a:hover { border-color: var(--border-strong); transform: translateX(4px); }
  .back-link:hover i { transform: translateX(-3px); }
  .next-card:hover { border-color: var(--border-strong); }
  .next-card:hover .arrow { transform: translateX(6px) rotate(-45deg); }
  .to-top.is-visible:hover { transform: translateY(-2px); }
}
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Section scaffolding ---------- */
.section { position: relative; padding-block: clamp(80px, 11vw, 140px); }
.section--alt { background: var(--bg-elev); border-block: 1px solid var(--border); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: .8rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }

.section-head { display: grid; gap: 16px; max-width: 720px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); }
.section-head p { font-size: 1.075rem; color: var(--muted); max-width: 58ch; }
.section-head--split { max-width: none; grid-template-columns: 1fr auto; align-items: end; gap: 24px 40px; }
@media (max-width: 760px) { .section-head--split { grid-template-columns: 1fr; } }

/* ---------- Reveal on scroll ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 44px, 0);
  filter: blur(8px);
}
.js [data-reveal="fade"] { transform: none; filter: none; }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal="pop"] { transform: translate3d(0, 56px, 0) scale(.9) rotateX(10deg); transform-origin: 50% 100%; }
.js [data-reveal="left"] { transform: translate3d(-48px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(48px, 0, 0); }
.js [data-reveal="mask"] { filter: none; transform: translate3d(0, 40%, 0); clip-path: inset(0 0 100% 0); }
.js [data-reveal="wipe"] { filter: none; transform: scale(1.08); clip-path: inset(0 100% 0 0 round var(--radius-lg)); }
.js [data-reveal].is-in {
  opacity: 1; transform: none; filter: none; clip-path: inset(0 0 0 0 round 0);
  transition: opacity 900ms var(--ease-out), transform 1000ms var(--ease-out), filter 900ms var(--ease-out), clip-path 1000ms var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.js [data-reveal="wipe"].is-in { clip-path: inset(0 0 0 0 round var(--radius-lg)); transition-duration: 900ms, 1400ms, 900ms, 1100ms; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 48px) 0 72px;
  overflow: hidden; isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 30%, transparent 75%);
}
.hero-glow {
  position: absolute; border-radius: 50%; filter: blur(70px);
}
.hero-glow--a { width: 520px; height: 520px; right: -120px; top: 4%; background: var(--accent-glow); }
.hero-glow--b { width: 420px; height: 420px; left: -160px; bottom: -80px; background: color-mix(in srgb, var(--slate) 22%, transparent); }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }

.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  font-size: .85rem; font-weight: 500; color: var(--text);
}
.hero-kicker .dot {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: .8rem;
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: 1.02; letter-spacing: -.035em; font-weight: 600;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--accent); font-style: normal; position: relative; white-space: nowrap; }
.hero h1 .accent::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .09em; border-radius: 4px;
  background: currentColor; opacity: .35;
  transform-origin: 0 50%; transform: scaleX(var(--underline, 1));
}
.js .hero h1 .accent::after { --underline: 0; }
.js .hero.is-ready h1 .accent::after { --underline: 1; transition: transform 900ms var(--ease-out) 900ms; }

.hero .word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.hero .word > span { display: inline-block; }
.js .hero .word > span { transform: translateY(105%); }
.js .hero.is-ready .word > span { transform: none; transition: transform 700ms var(--ease-out); transition-delay: calc(var(--i) * 60ms + 100ms); }

.hero-lead { margin-top: 24px; max-width: 50ch; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

.js .hero [data-hero-in] { opacity: 0; transform: translateY(16px); }
.js .hero.is-ready [data-hero-in] { opacity: 1; transform: none; transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: var(--delay, 0ms); }

/* Hero stage (capturas reais dos projetos) */
.hero-stage {
  position: relative; aspect-ratio: 1 / .86; perspective: 1400px;
}
.stage-inner {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 600ms var(--ease-out);
}
.frame-browser {
  position: absolute; left: 0; top: 8%; width: 88%;
  border-radius: 14px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.frame-browser .bar {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.frame-browser .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.frame-browser .bar i:first-child { background: #e0685d; }
.frame-browser .bar i:nth-child(2) { background: #e7b04f; }
.frame-browser .bar i:nth-child(3) { background: #5cb87a; }
.frame-browser .bar span {
  margin-left: 12px; flex: 1; max-width: 260px; height: 20px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .68rem; line-height: 18px; padding-left: 10px; color: var(--muted); overflow: hidden; white-space: nowrap;
}
.frame-browser img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; object-position: top; }

.frame-phone {
  position: absolute; right: 0; bottom: 0; width: 31%;
  padding: 7px; border-radius: 30px; background: #12161c;
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgba(255,255,255,.08);
  transform: translateZ(60px);
}
.frame-phone img { border-radius: 24px; width: 100%; aspect-ratio: 466 / 990; object-fit: cover; }
.frame-phone::before {
  content: ""; position: absolute; top: 14px; left: 50%; width: 30%; height: 12px; margin-left: -15%;
  border-radius: 999px; background: #12161c; z-index: 1;
}

.stage-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  font-size: .8rem; font-weight: 600; color: var(--ink); white-space: nowrap;
  transform: translateZ(90px);
}
.stage-chip i { color: var(--accent); font-size: .95rem; }
.stage-chip--a { left: -4%; bottom: 30%; }
.stage-chip--b { right: 24%; top: 0; }

.js .hero .frame-browser { opacity: 0; transform: translateY(30px) scale(.97); }
.js .hero .frame-phone { opacity: 0; transform: translateY(50px) translateZ(60px); }
.js .hero .stage-chip { opacity: 0; transform: translateY(10px) scale(.9) translateZ(90px); }
.js .hero.is-ready .frame-browser { opacity: 1; transform: none; transition: opacity 1s var(--ease-out) 250ms, transform 1.1s var(--ease-out) 250ms; }
.js .hero.is-ready .frame-phone { opacity: 1; transform: translateZ(60px); transition: opacity 1s var(--ease-out) 500ms, transform 1.1s var(--ease-out) 500ms; }
.js .hero.is-ready .stage-chip { opacity: 1; transform: translateZ(90px); transition: opacity 600ms var(--ease-out), transform 700ms cubic-bezier(.34, 1.56, .64, 1); }
.js .hero.is-ready .stage-chip--a { transition-delay: 1000ms; }
.js .hero.is-ready .stage-chip--b { transition-delay: 1150ms; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--muted);
  transition: color var(--dur) ease, border-color var(--dur) ease;
}
.scroll-cue:hover { color: var(--ink); border-color: var(--ink); }
.scroll-cue i { animation: cue 2.4s var(--ease-in-out) infinite; }
@keyframes cue { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(4px); } }

@media (max-width: 960px) {
  .hero { min-height: auto; padding-top: calc(var(--header-h) + 40px); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stage { max-width: 560px; width: 100%; margin-inline: auto; }
  .scroll-cue { display: none; }
}
@media (max-width: 520px) {
  .stage-chip { font-size: .72rem; padding: 7px 11px; }
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- Projects ---------- */
.filters {
  position: relative; display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
}
.filters button {
  position: relative; z-index: 1; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; font-size: .9rem; font-weight: 500; color: var(--muted);
  transition: color var(--dur) ease;
}
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--on-accent); }
.filters .pill {
  position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 999px; background: var(--accent-strong);
  width: var(--w, 0); transform: translateX(var(--x, 0));
  transition: transform 420ms var(--ease-out), width 420ms var(--ease-out);
}
.filters button .count { margin-left: 6px; font-size: .75rem; opacity: .7; font-variant-numeric: tabular-nums; }

.projects-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
}
@media (max-width: 1024px) { .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .projects-grid { grid-template-columns: 1fr; } }

.project {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out), border-color var(--dur) ease, opacity 300ms ease;
}
.project.is-hiding { opacity: 0; transform: scale(.96); transition-duration: 180ms; }
.project.is-hidden { display: none; }
.project.is-showing { animation: card-in 520ms var(--ease-out) both; animation-delay: var(--stagger, 0ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.project-media {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--surface-2);
}
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 600ms var(--ease-out); }
.project-media--contain img { object-fit: contain; padding: 14px 0 0; object-position: center bottom; }
.project-media--contain { background:
  radial-gradient(120% 90% at 50% 110%, var(--accent-soft), transparent 60%), var(--surface-2); }
.project-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  transform: translateX(-130%);
}
.project-type {
  position: absolute; left: 14px; top: 14px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink);
}
.project-type i { color: var(--accent); }

.project-body { display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 24px; flex: 1; }
.project-body h3 { font-size: 1.2rem; letter-spacing: -.01em; }
.project-body p { color: var(--muted); font-size: .95rem; }
.project-link {
  margin-top: auto; padding-top: 14px; display: inline-flex; align-items: center; gap: 8px;
  font-size: .9rem; font-weight: 600; color: var(--accent);
}
.project-link i { transition: transform var(--dur) var(--ease-out); }
.project-link::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.project:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.project-link:focus-visible { outline: none; }
.project-zoom {
  position: absolute; right: 14px; top: 14px; z-index: 3;
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border);
  color: var(--ink); opacity: 0; transform: scale(.85);
  transition: opacity var(--dur) ease, transform var(--dur) var(--ease-out);
}
.project-zoom:focus-visible { opacity: 1; transform: none; }

@media (hover: hover) and (pointer: fine) {
  .project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
  .project:hover .project-media img { transform: scale(1.06); }
  .project:hover .project-media::after { transform: translateX(130%); transition: transform 900ms var(--ease-out); }
  .project:hover .project-link i { transform: translateX(4px); }
  .project:hover .project-zoom { opacity: 1; transform: none; }
}
@media (hover: none) { .project-zoom { opacity: 1; transform: none; } }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 960px) { .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }

.service {
  position: relative; padding: 30px 28px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); overflow: hidden; isolation: isolate;
  transition: border-color var(--dur) ease, transform 300ms var(--ease-out);
}
.service::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 60%);
  transition: opacity 400ms ease;
}
.service-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent); font-size: 1.4rem;
  transition: transform 300ms cubic-bezier(.34, 1.56, .64, 1);
}
.service h3 { margin-top: 22px; font-size: 1.25rem; }
.service p { margin-top: 10px; color: var(--muted); font-size: .97rem; }
.service-num { position: absolute; right: 24px; top: 26px; font-family: var(--font-display); font-size: .8rem; font-weight: 600; color: var(--border-strong); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) {
  .service:hover { border-color: var(--border-strong); transform: translateY(-3px); }
  .service:hover::before { opacity: 1; }
  .service:hover .service-icon { transform: rotate(-6deg) scale(1.06); }
}

/* ---------- Why (diferenciais) ---------- */
.why-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(40px, 7vw, 100px); align-items: start; }
.why-intro { position: sticky; top: calc(var(--header-h) + 40px); display: grid; gap: 18px; }
.why-intro h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); }
.why-intro p { color: var(--muted); font-size: 1.075rem; max-width: 46ch; }
.why-list { border-top: 1px solid var(--border); }
.why-item {
  display: grid; grid-template-columns: 56px 1fr; gap: 6px 18px; padding: 26px 0;
  border-bottom: 1px solid var(--border); position: relative;
}
.why-item::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
  transition: transform 700ms var(--ease-out);
}
.why-item .ico {
  grid-row: span 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--accent); font-size: 1.2rem;
  transition: background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.why-item h3 { font-size: 1.15rem; align-self: end; }
.why-item p { color: var(--muted); font-size: .97rem; }
@media (max-width: 860px) {
  .why-grid { grid-template-columns: 1fr; }
  .why-intro { position: static; }
}

/* ---------- About ---------- */
.about-card {
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: center;
}
.about-photo {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1;
  background: var(--surface-2); border: 1px solid var(--border);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-text { display: grid; gap: 18px; }
.about-text h2 { font-size: clamp(1.9rem, 3.8vw, 2.75rem); }
.about-text p { font-size: 1.075rem; max-width: 60ch; }
.about-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.fact {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: .875rem; font-weight: 500; color: var(--ink);
}
.fact i { color: var(--accent); }
@media (max-width: 760px) { .about-card { grid-template-columns: 1fr; } .about-photo { max-width: 320px; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact-intro { display: grid; gap: 18px; }
.contact-intro h2 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
.contact-intro p { color: var(--muted); font-size: 1.075rem; max-width: 42ch; }
.contact-list { display: grid; gap: 12px; margin-top: 12px; }
.contact-list a, .contact-list div {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--ink); font-weight: 500;
  transition: border-color var(--dur) ease, transform var(--dur) var(--ease-out);
}
.contact-list i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 1.1rem; flex-shrink: 0; }
.contact-list small { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); }

.form {
  padding: clamp(24px, 4vw, 40px); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.field { display: grid; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: .875rem; font-weight: 600; color: var(--ink); }
.field input, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 1rem;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .75; }
.field input:hover, .field textarea:hover { border-color: var(--border-strong); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.field .err { font-size: .82rem; color: var(--danger); min-height: 0; }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.form-foot .note { font-size: .85rem; color: var(--muted); }
.form .btn .spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.form.is-sending .btn .spinner { display: inline-block; }
.form.is-sending .btn i { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-status {
  grid-column: 1 / -1; display: none; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px;
  font-weight: 500; font-size: .95rem;
}
.form-status.is-visible { display: flex; animation: status-in 400ms var(--ease-out); }
.form-status.is-success { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.form-status.is-error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.form-status svg { flex-shrink: 0; width: 26px; height: 26px; }
.form-status svg circle, .form-status svg path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.form-status svg circle { stroke-dasharray: 70; stroke-dashoffset: 70; animation: draw 600ms var(--ease-out) forwards; }
.form-status svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 400ms var(--ease-out) 450ms forwards; }
.form-status.is-error.is-visible { animation: status-in 400ms var(--ease-out), shake 420ms ease 650ms; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes status-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } .form-foot .btn { width: 100%; } }

/* ---------- Footer ---------- */
.site-footer { padding: 72px 0 32px; border-top: 1px solid var(--border); background: var(--bg-elev); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-brand img { height: 32px; width: auto; }
.footer-brand p { margin-top: 18px; max-width: 42ch; color: var(--muted); font-size: .95rem; }
.footer-col h4 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 16px; }
.footer-col ul { display: grid; gap: 10px; }
.footer-col a, .footer-col li { color: var(--text); font-size: .95rem; transition: color var(--dur-fast) ease; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .85rem; color: var(--muted); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--ink); color: var(--bg); border: 0; cursor: pointer; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: opacity var(--dur) ease, transform var(--dur) var(--ease-out);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Project detail pages ---------- */
.detail-hero { min-height: 0; display: block; padding: calc(var(--header-h) + 56px) 0 48px; position: relative; overflow: hidden; isolation: isolate; }
.detail-hero .hero-bg::before { -webkit-mask-image: radial-gradient(ellipse 60% 80% at 80% 0%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse 60% 80% at 80% 0%, #000 20%, transparent 70%); }
.back-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: .9rem; font-weight: 500; color: var(--text);
  transition: border-color var(--dur) ease, color var(--dur) ease;
}
.back-link i { transition: transform var(--dur) var(--ease-out); }
.back-link:hover { color: var(--ink); border-color: var(--border-strong); }
.detail-head { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 24px clamp(32px, 6vw, 80px); align-items: end; }
.detail-head h1 { margin-top: 14px; font-size: clamp(2.2rem, 5.4vw, 4rem); letter-spacing: -.03em; text-wrap: balance; }
.detail-head .subtitle { margin-top: 14px; font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--ink); font-family: var(--font-display); font-weight: 500; }
.detail-aside { display: grid; gap: 18px; }
.detail-aside p { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 600;
}
.tag::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%); transform: translateX(-120%); }
.tag.is-in::after { animation: sweep 900ms var(--ease-out) var(--delay, 0ms) both; }
@keyframes sweep { to { transform: translateX(120%); } }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.info-list { display: grid; gap: 10px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: .92rem; }
.info-list li { display: grid; gap: 2px; }
.info-list strong { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.info-list a { color: var(--accent); word-break: break-word; }
@media (max-width: 860px) { .detail-head { grid-template-columns: 1fr; } }

.gallery-section { padding: 24px 0 clamp(64px, 9vw, 110px); }
.gallery-group + .gallery-group { margin-top: clamp(48px, 7vw, 80px); }
.gallery-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.gallery-group-head h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.gallery-group-head span { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gallery { display: grid; gap: 20px; }
.gallery--web { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery--app { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (max-width: 700px) { .gallery--web { grid-template-columns: 1fr; } .gallery--app { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
.shot { display: grid; gap: 10px; }
.shot a {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out), border-color var(--dur) ease;
}
.gallery--web .shot a { aspect-ratio: 16 / 10; }
.gallery--app .shot a { aspect-ratio: 9 / 19; border-radius: 22px; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 600ms var(--ease-out); }
.gallery--legacy .shot img { object-fit: contain; object-position: center; }
.shot a::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); transform: translateX(-130%); }
.shot a .zoom { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--border); color: var(--ink); opacity: 0; transform: scale(.85); transition: opacity var(--dur) ease, transform var(--dur) var(--ease-out); }
.shot figcaption { font-size: .88rem; color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  .shot a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
  .shot a:hover img { transform: scale(1.04); }
  .shot a:hover::after { transform: translateX(130%); transition: transform 900ms var(--ease-out); }
  .shot a:hover .zoom { opacity: 1; transform: none; }
}

.next-project { padding-bottom: clamp(64px, 9vw, 110px); }
.next-card {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px;
  padding: clamp(24px, 4vw, 40px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  transition: border-color var(--dur) ease;
}
.next-card small { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.next-card h2 { margin-top: 8px; font-size: clamp(1.4rem, 3vw, 2.2rem); }
.next-card .arrow { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--accent-strong); color: #fff; font-size: 1.4rem; transition: transform 300ms var(--ease-out); }

/* GLightbox: harmoniza com a marca */
.glightbox-clean .gslide-description { background: var(--surface); }
.glightbox-clean .gslide-title { font-family: var(--font-display); color: var(--ink); margin-bottom: 0; }
.goverlay { background: rgba(10, 12, 16, .92); }


/* ==========================================================================
   Camada de movimento v2: hero vivo, faixa animada, entradas e filtro
   ========================================================================== */

/* Fundo do hero: rede de pontos em canvas + luz que segue o cursor */
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-spot {
  position: absolute; width: 640px; height: 640px; left: 0; top: 0; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 62%);
  transform: translate3d(calc(var(--sx, 70vw) - 50%), calc(var(--sy, 30vh) - 50%), 0);
  transition: transform 900ms var(--ease-out), opacity 600ms ease;
  opacity: 0;
}
.hero.has-pointer .hero-spot { opacity: .9; }
.hero-glow--a { animation: drift-a 18s ease-in-out infinite alternate; }
.hero-glow--b { animation: drift-b 22s ease-in-out infinite alternate; }
@keyframes drift-a { to { translate: -140px 80px; scale: 1.15; } }
@keyframes drift-b { to { translate: 160px -60px; scale: .9; } }

/* Palavra que alterna no título */
.hero h1 { perspective: 600px; }
.word--rot { overflow: visible !important; }
.rotator { display: inline-grid; color: var(--accent); position: relative; }
.rotator-word {
  grid-area: 1 / 1; justify-self: start; white-space: nowrap; position: relative;
  opacity: 0; transform: translate3d(0, .55em, 0) rotateX(-70deg); filter: blur(10px);
  transform-origin: 50% 100%;
  transition: opacity 550ms var(--ease-out), transform 700ms var(--ease-out), filter 550ms var(--ease-out);
}
.rotator-word.is-active { opacity: 1; transform: none; filter: none; }
.rotator-word.is-leaving { opacity: 0; transform: translate3d(0, -.45em, 0) rotateX(70deg); filter: blur(10px); transition-duration: 380ms; }
.rotator-word::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .04em; height: .09em; border-radius: 4px;
  background: currentColor; opacity: .3; transform-origin: 0 50%; transform: scaleX(0);
}
.rotator-word.is-active::after { transform: scaleX(1); transition: transform 800ms var(--ease-out) 250ms; }

/* Números do hero */
.hero-stats { margin: 44px 0 0; display: flex; flex-wrap: wrap; gap: 14px 40px; }
.stat { display: grid; gap: 2px; position: relative; padding-left: 16px; }
.stat::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent), transparent); }
.stat dt { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat dd { margin: 0; font-size: .85rem; color: var(--muted); }

/* Movimento contínuo da cena (propriedade translate, independente do transform de entrada) */
.hero.is-ready .frame-browser { animation: bob 7s ease-in-out 1.6s infinite; }
.hero.is-ready .frame-phone { animation: bob 6s ease-in-out 2s infinite reverse; }
.hero.is-ready .stage-chip--a { animation: bob 5s ease-in-out 1.8s infinite; }
.hero.is-ready .stage-chip--b { animation: bob 5.5s ease-in-out 2.2s infinite reverse; }
.hero.is-ready .stage-code { animation: bob 6.5s ease-in-out 2.4s infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }

/* Cartão de código digitando */
.stage-code {
  position: absolute; left: 6%; bottom: -2%; z-index: 3; width: min(330px, 62%);
  padding: 12px 14px 14px; border-radius: 14px;
  background: #151a21; color: #e8e4dd; border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow-lg); transform: translateZ(110px);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .74rem;
}
.code-dots { display: flex; gap: 5px; margin-bottom: 10px; }
.code-dots i { width: 8px; height: 8px; border-radius: 50%; background: #3a424d; }
.code-dots i:first-child { background: #e0685d; }
.stage-code code { display: flex; align-items: center; white-space: nowrap; overflow: hidden; min-height: 1.2em; }
.code-ln { color: #5f6773; margin-right: 12px; }
.stage-code [data-typer] { color: #f0b2a8; }
.caret { display: inline-block; width: 7px; height: 1.1em; margin-left: 2px; background: #ef9184; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.js .hero .stage-code { opacity: 0; transform: translateY(24px) translateZ(110px); }
.js .hero.is-ready .stage-code { opacity: 1; transform: translateZ(110px); transition: opacity 700ms var(--ease-out) 1300ms, transform 900ms cubic-bezier(.34, 1.4, .64, 1) 1300ms; }

/* Notificações que aparecem sobre a cena */
.stage-toasts { position: absolute; right: 18%; top: 30%; z-index: 4; width: 250px; height: 64px; transform: translateZ(130px); }
.toast {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translate3d(0, 18px, 0) scale(.92);
  transition: opacity 380ms var(--ease-out), transform 520ms cubic-bezier(.34, 1.45, .64, 1);
}
.toast.is-on { opacity: 1; transform: none; }
.toast.is-off { opacity: 0; transform: translate3d(0, -14px, 0) scale(.96); transition-duration: 260ms; }
.toast-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-strong); color: #fff; font-size: 1rem; flex-shrink: 0; }
.toast.is-on .toast-ico { animation: ping 900ms var(--ease-out) 200ms; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 100% { box-shadow: 0 0 0 14px transparent; } }
.toast strong { display: block; font-size: .82rem; color: var(--ink); line-height: 1.25; }
.toast small { display: block; font-size: .72rem; color: var(--muted); }

/* Toque simulado no celular */
.tap {
  position: absolute; right: 12%; bottom: 22%; z-index: 5; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.55); box-shadow: 0 0 0 2px rgba(255,255,255,.7);
  transform: translateZ(100px) scale(0); opacity: 0; pointer-events: none;
}
.hero.is-ready .tap { animation: tap 3.4s ease-out 2.4s infinite; }
@keyframes tap {
  0%, 62% { transform: translateZ(100px) scale(.4); opacity: 0; }
  68% { transform: translateZ(100px) scale(.8); opacity: 1; }
  100% { transform: translateZ(100px) scale(2.2); opacity: 0; }
}
@media (max-width: 520px) {
  .stage-toasts { right: 4%; top: 22%; width: 210px; height: 58px; }
  .stage-code { font-size: .64rem; width: 72%; }
  .hero-stats { gap: 14px 24px; }
  .stat dt { font-size: 1.6rem; }
}

/* Faixa animada entre o hero e os projetos */
.marquee {
  position: relative; overflow: hidden; padding: 22px 0;
  border-block: 1px solid var(--border); background: var(--bg-elev);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; align-items: center; gap: 28px; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--font-display); font-size: clamp(1.1rem, 2vw, 1.5rem); font-weight: 500; color: var(--ink); white-space: nowrap; }
.marquee i { color: var(--accent); font-size: .9rem; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* Cards de projeto: inclinação 3D com reflexo que segue o mouse */
.projects-grid { perspective: 1400px; }
.project::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.2), transparent 45%);
  opacity: 0; transition: opacity 300ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .project.is-tilting { transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)) translateY(-6px); transition: transform 120ms linear, box-shadow 300ms ease, border-color 300ms ease; }
  .project.is-tilting::after { opacity: 1; }
}

/* Filtro: estados de saída e entrada usados pelo FLIP em JS */
.project.is-hiding { opacity: 0; transform: scale(.85) translateY(10px); filter: blur(4px); transition: opacity 220ms ease, transform 260ms var(--ease-out), filter 220ms ease; }
.project.is-showing { animation: card-in 600ms var(--ease-out) both; animation-delay: var(--stagger, 0ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(30px) scale(.88); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.filters .count { display: inline-block; }
.filters .count.bump { animation: bump 400ms cubic-bezier(.34, 1.6, .64, 1); }
@keyframes bump { 40% { transform: scale(1.5); } }

/* Serviços: borda em degradê que gira no hover */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.service::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle), transparent 0 60%, var(--accent) 80%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 300ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .service:hover::after { opacity: 1; animation: spin-border 2.6s linear infinite; }
}
@keyframes spin-border { to { --angle: 360deg; } }
.service.is-in .service-icon { animation: icon-pop 700ms cubic-bezier(.34, 1.6, .64, 1) both; animation-delay: calc(var(--delay, 0ms) + 250ms); }
@keyframes icon-pop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Diferenciais: linha que acompanha a rolagem */
.why-list { position: relative; }
.why-list::before {
  content: ""; position: absolute; left: 23px; top: 0; bottom: 0; width: 2px; border-radius: 2px;
  background: linear-gradient(var(--accent), var(--accent-strong));
  transform-origin: 50% 0; transform: scaleY(var(--why-progress, 0));
}
.why-item .ico { position: relative; z-index: 1; background: var(--bg); }
.why-item.is-in .ico { animation: icon-pop 700ms cubic-bezier(.34, 1.6, .64, 1) both; animation-delay: calc(var(--delay, 0ms) + 200ms); }

/* Botão principal magnético */
.btn-magnetic { transition: transform 250ms var(--ease-out), box-shadow var(--dur) ease, background-color var(--dur) ease; }


/* ==========================================================================
   Seta do hero: anéis vermelhos que pulsam e se expandem
   ========================================================================== */
.scroll-cue {
  width: 52px; height: 52px; color: var(--accent); border: 1.5px solid var(--accent);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: 0 0 0 0 var(--accent-glow); z-index: 2;
}
.scroll-cue:hover { color: #fff; background: var(--accent-strong); border-color: var(--accent-strong); }
.scroll-cue::before, .scroll-cue::after {
  content: ""; position: absolute; inset: -1.5px; border-radius: 50%;
  border: 2px solid var(--accent); pointer-events: none;
  animation: cue-ring 2.4s cubic-bezier(.2, .7, .3, 1) infinite;
}
.scroll-cue::after { animation-delay: 1.2s; }
@keyframes cue-ring {
  0% { transform: scale(1); opacity: .85; }
  100% { transform: scale(2.6); opacity: 0; }
}
.scroll-cue i { font-size: 1.15rem; }

/* ==========================================================================
   Projetos: mapa de dispositivos que também filtra a lista
   ========================================================================== */
.hub {
  position: relative; width: 100%; max-width: 1000px; margin: 0 auto clamp(48px, 7vw, 80px);
  aspect-ratio: 1000 / 340;
}
.hub-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hub-path {
  fill: none; stroke: var(--border-strong); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 3 9; animation: hub-dash 1.2s linear infinite;
  transition: stroke 400ms ease, stroke-width 400ms ease, opacity 400ms ease;
}
@keyframes hub-dash { to { stroke-dashoffset: -24; } }
.hub-dot { fill: var(--accent); opacity: 0; transition: opacity 400ms ease; filter: drop-shadow(0 0 6px var(--accent)); }

/* Estado: tudo aceso em "Todos"; só a linha ativa quando há filtro */
.hub[data-active="*"] .hub-path { stroke: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); }
.hub[data-active="*"] .hub-dot { opacity: .9; }
.hub[data-active="web"] .hub-path--web,
.hub[data-active="sistemas"] .hub-path--sistemas,
.hub[data-active="aplicativos"] .hub-path--aplicativos { stroke: var(--accent); stroke-width: 3; stroke-dasharray: none; }
.hub[data-active="web"] .hub-dot--web,
.hub[data-active="sistemas"] .hub-dot--sistemas,
.hub[data-active="aplicativos"] .hub-dot--aplicativos { opacity: 1; }
.hub:not([data-active="*"]) .hub-path:not(.hub-path--web):not(.hub-path--sistemas):not(.hub-path--aplicativos) { opacity: .4; }
.hub[data-active="web"] .hub-path:not(.hub-path--web),
.hub[data-active="sistemas"] .hub-path:not(.hub-path--sistemas),
.hub[data-active="aplicativos"] .hub-path:not(.hub-path--aplicativos) { opacity: .35; }

.hub-node, .hub-core {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 0; border: 0; background: none; cursor: pointer; color: inherit; font: inherit;
  transform: translate(-50%, -50%);
  transition: opacity 400ms ease, filter 400ms ease;
  -webkit-tap-highlight-color: transparent;
}
.hub-node--web { left: 19%; top: 23.5%; }
.hub-node--sistemas { left: 19%; top: 77%; }
.hub-node--aplicativos { left: 81.2%; top: 50%; }
.hub-core { left: 50%; top: 50%; }
.hub-node:focus-visible, .hub-core:focus-visible { outline: none; }
.hub-node:focus-visible .device, .hub-core:focus-visible .core-dot { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Nó inativo quando outro está selecionado */
.hub:not([data-active="*"]) .hub-node[aria-pressed="false"] { opacity: .5; filter: grayscale(.6); }
.hub:not([data-active="*"]) .hub-node[aria-pressed="false"]:hover { opacity: .85; filter: none; }

.hub-label { display: grid; gap: 2px; text-align: center; white-space: nowrap; }
.hub-label strong { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--ink); }
.hub-label small { font-size: .78rem; color: var(--muted); }
.hub-label .count {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; margin-left: 4px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-variant-numeric: tabular-nums;
  vertical-align: 2px;
}
.hub-node[aria-pressed="true"] .count, .hub-core[aria-pressed="true"] .count { background: var(--accent-strong); color: #fff; }

/* Núcleo (Todos) */
.hub-core .core-dot {
  position: relative; z-index: 1; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent-strong) 70%, #fff), var(--accent-strong) 60%);
  color: #fff; font-size: 1.9rem; box-shadow: 0 16px 40px -12px var(--accent-glow), inset 0 0 0 6px rgba(255,255,255,.12);
  transition: transform 400ms cubic-bezier(.34, 1.56, .64, 1);
}
.hub-core:hover .core-dot { transform: scale(1.06) rotate(-6deg); }
.core-ring {
  position: absolute; left: 50%; top: 42px; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0; pointer-events: none;
  animation: hub-ring 3s cubic-bezier(.2, .7, .3, 1) infinite;
}
.core-ring--2 { animation-delay: 1.5s; }
@keyframes hub-ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.3); opacity: 0; } }

/* Dispositivos ilustrados */
.device {
  position: relative; display: block; background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md); overflow: hidden;
  transition: transform 450ms cubic-bezier(.34, 1.56, .64, 1), box-shadow 400ms ease, border-color 400ms ease;
}
.hub-node:hover .device { transform: translateY(-6px) scale(1.04); }
.hub-node[aria-pressed="true"] .device {
  transform: scale(1.08); border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 22px 44px -18px var(--accent-glow);
}
.device i, .device b { display: block; font-style: normal; }

/* Navegador (Sites) */
.device--browser { width: 158px; height: 104px; border-radius: 12px; }
.device--browser .d-bar { display: flex; gap: 4px; align-items: center; height: 18px; padding: 0 8px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.device--browser .d-bar b { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.device--browser .d-bar b:first-child { background: #e0685d; }
.device--browser .d-hero {
  margin: 8px 8px 6px; height: 36px; border-radius: 6px;
  background: linear-gradient(110deg, var(--accent-soft) 30%, color-mix(in srgb, var(--accent) 30%, transparent) 50%, var(--accent-soft) 70%);
  background-size: 250% 100%; animation: shimmer-bg 2.6s linear infinite;
}
.device--browser .d-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 0 8px; }
.device--browser .d-cards b { height: 26px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); }
@keyframes shimmer-bg { to { background-position: -150% 0; } }

/* Monitor (Sistemas) */
.device--monitor { width: 168px; height: auto; background: none; border: 0; box-shadow: none; overflow: visible; }
.device--monitor .d-screen {
  display: flex; gap: 6px; height: 100px; padding: 8px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md);
  transition: border-color 400ms ease, box-shadow 400ms ease;
}
.hub-node--sistemas[aria-pressed="true"] .device--monitor { box-shadow: none; }
.hub-node--sistemas[aria-pressed="true"] .d-screen { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), 0 22px 44px -18px var(--accent-glow); }
.device--monitor .d-side { width: 26px; border-radius: 5px; background: var(--surface-2); }
.device--monitor .d-chart { flex: 1; display: flex; align-items: flex-end; gap: 6px; padding: 6px; border-radius: 5px; background: var(--surface-2); }
.device--monitor .d-chart b { flex: 1; border-radius: 3px 3px 1px 1px; background: var(--accent); transform-origin: 50% 100%; animation: bar-grow 2.8s cubic-bezier(.22, 1, .36, 1) infinite; }
.device--monitor .d-chart b:nth-child(1) { height: 40%; animation-delay: 0s; opacity: .55; }
.device--monitor .d-chart b:nth-child(2) { height: 65%; animation-delay: .15s; opacity: .7; }
.device--monitor .d-chart b:nth-child(3) { height: 50%; animation-delay: .3s; opacity: .6; }
.device--monitor .d-chart b:nth-child(4) { height: 85%; animation-delay: .45s; opacity: .85; }
.device--monitor .d-chart b:nth-child(5) { height: 100%; animation-delay: .6s; }
@keyframes bar-grow { 0% { transform: scaleY(.15); } 35%, 80% { transform: scaleY(1); } 100% { transform: scaleY(.15); } }
.device--monitor .d-stand { width: 40px; height: 14px; margin: 0 auto; background: var(--border-strong); clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%); }

/* Celular (Aplicativos) */
.device--phone { width: 82px; height: 156px; border-radius: 18px; padding: 16px 7px 8px; border: 3px solid var(--ink); background: var(--surface); }
.device--phone .d-notch { position: absolute; top: 5px; left: 50%; width: 26px; height: 6px; margin-left: -13px; border-radius: 6px; background: var(--ink); }
.device--phone .d-rows { display: grid; gap: 6px; }
.device--phone .d-rows b {
  height: 20px; border-radius: 6px; background: var(--surface-2); border-left: 3px solid var(--accent);
  animation: row-in 3.2s cubic-bezier(.22, 1, .36, 1) infinite;
}
.device--phone .d-rows b:nth-child(2) { animation-delay: .2s; }
.device--phone .d-rows b:nth-child(3) { animation-delay: .4s; }
.device--phone .d-rows b:nth-child(4) { animation-delay: .6s; }
@keyframes row-in { 0% { transform: translateX(-110%); opacity: 0; } 20%, 85% { transform: none; opacity: 1; } 100% { transform: none; opacity: 0; } }
.device--phone .d-tab { position: absolute; left: 7px; right: 7px; bottom: 7px; height: 14px; border-radius: 5px; background: var(--surface-2); }
.hub-node--aplicativos[aria-pressed="true"] .device--phone { border-color: var(--accent); }

/* Celular: o mapa vira uma grade de botões com os mesmos dispositivos */
@media (max-width: 760px) {
  .hub { aspect-ratio: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 28px 12px; justify-items: center; }
  .hub-lines { display: none; }
  .hub-node, .hub-core { position: relative; left: auto !important; top: auto !important; transform: none; }
  .hub-core { grid-column: 1 / -1; order: -1; }
  .hub-node--aplicativos { grid-column: 1 / -1; }
  .core-ring { top: 42px; }
  .device--browser { width: 132px; height: 88px; }
  .device--monitor { width: 140px; }
  .device--monitor .d-screen { height: 84px; }
}

/* Mesmo com 'reduzir movimento', estes pulsos pequenos continuam (não deslocam conteúdo) */
html.reduce-motion .scroll-cue i { animation: none; }

/* ---------- Reduzir movimento: versão mais suave, sem desligar tudo ----------
   Mantém fades e deslocamentos curtos; remove loops contínuos, parallax e inclinação. */
html.reduce-motion { scroll-behavior: auto; }
html.reduce-motion .js-loop,
html.reduce-motion .marquee-track,
html.reduce-motion .scroll-cue i,
html.reduce-motion .frame-browser, html.reduce-motion .frame-phone, html.reduce-motion .stage-chip,
html.reduce-motion .stage-code, html.reduce-motion .tap { animation: none !important; }
html.reduce-motion .hero-glow { animation: none !important; }
html.reduce-motion .rotator-word, html.reduce-motion .rotator-word.is-leaving { transform: none; filter: none; }
html.reduce-motion .project.is-showing { animation-name: fade-in; }
@keyframes fade-in { from { opacity: 0; } }
html.reduce-motion.js [data-reveal]:not(.is-in) { transform: translate3d(0, 12px, 0); filter: none; clip-path: none; }
html.reduce-motion.js [data-reveal].is-in { transition: opacity 600ms ease, transform 600ms var(--ease-out); transition-delay: var(--delay, 0ms); }
html.reduce-motion .stage-inner { transform: none !important; }
html.reduce-motion .hero-spot { display: none; }

/* Palavra alternada entra junto com o título */
.js .hero .word--rot .rotator { opacity: 0; filter: blur(8px); }
.js .hero.is-ready .word--rot .rotator { opacity: 1; filter: none; transition: opacity 700ms var(--ease-out) 380ms, filter 700ms var(--ease-out) 380ms; }
