:root {
  --bg: #0a0c0d;
  --fg: #eceeed;
  --muted: #9aa3a0;
  --rule: rgba(236, 238, 237, 0.16);
  --pen: #ff4d1f;
  --pad: clamp(28px, 5vw, 72px);
  --max: 1360px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Funnel Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Funnel Display", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; scrollbar-color: #2a3032 var(--bg); scrollbar-width: thin; }
body {
  margin: 0; position: relative; background: var(--bg); color: var(--fg);
  font: 400 1rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; caret-color: var(--pen);
}
::selection { background: var(--pen); color: var(--bg); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 2px; }
p, h1, h2 { margin: 0; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 20; background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 4px; }
.skip:focus { top: 12px; }

/* Linha */
.plot { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; overflow: visible; }
.plot path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.plot .ghost { stroke: rgba(236, 238, 237, 0.14); stroke-width: 1; }
.plot .ink { stroke: var(--pen); stroke-width: 2.5; }
.plot .pen { fill: var(--pen); stroke: var(--bg); stroke-width: 2; opacity: 0; transition: opacity 0.4s; }
.plot.live .pen { opacity: 1; }
.plot .node { fill: var(--bg); stroke: rgba(236, 238, 237, 0.4); stroke-width: 2; transition: fill 0.4s, stroke 0.4s; }
.plot .node.on { fill: var(--pen); stroke: var(--pen); }

/* Barra */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10; height: 64px; padding-inline: max(var(--pad), calc((100% - var(--max)) / 2));
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 1px 0 var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
.mark { width: 22px; height: 22px; fill: var(--fg); stroke: var(--pen); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mark path { fill: none; }
.bar nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 32px); font-size: 0.9375rem; }
.nl { text-decoration: none; color: var(--muted); padding-block: 6px; transition: color 0.2s; }
.nl:hover, .nl.keep { color: var(--fg); }
.lang { font: 500 0.8125rem/1 var(--mono); text-decoration: none; padding: 7px 9px; border: 1px solid var(--rule); border-radius: 4px; transition: background 0.2s, color 0.2s; }
.lang:hover { background: var(--fg); color: var(--bg); }
@media (max-width: 1040px) { .nl:not(.keep) { display: none; } }

/* Hero */
.hero {
  position: relative; min-height: min(100dvh, 1000px); display: flex; flex-direction: column; justify-content: flex-end;
  gap: clamp(48px, 9vh, 96px); padding: calc(64px + 10vh) max(var(--pad), calc((100% - var(--max)) / 2)) clamp(40px, 6vw, 72px);
  background: radial-gradient(70% 60% at 85% 0%, rgba(120, 140, 150, 0.16), transparent 70%);
}
.hero h1 { font-family: var(--display); font-size: clamp(2.5rem, 5.8vw, 5.25rem); font-weight: 600; line-height: 0.98; letter-spacing: -0.04em; margin-bottom: 36px; max-width: 12ch; text-wrap: balance; }
.stop { color: var(--pen); }
.sub { font-size: clamp(1.0625rem, 1.4vw, 1.3125rem); line-height: 1.4; color: var(--muted); max-width: 34ch; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; margin-top: 40px; }
.btn { display: inline-flex; align-items: center; min-height: 54px; padding: 0 28px; background: var(--pen); color: var(--bg); font-weight: 600; text-decoration: none; border-radius: 999px; transition: transform 0.12s ease-out, background 0.2s; }
.btn:hover { background: #ff6a40; }
.btn .wa { width: 22px; height: 22px; flex: none; margin-right: 10px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.btn .wa-t { fill: currentColor; stroke: none; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 0.9375rem; }
.bar .btn-sm { display: none; }
@media (min-width: 1100px) { .bar .btn-sm { display: inline-flex; } }
.btn:active { transform: scale(0.97); }
.ulink { text-decoration: underline; text-decoration-color: var(--pen); text-decoration-thickness: 2px; text-underline-offset: 5px; transition: text-decoration-thickness 0.2s; }
.ulink:hover { text-decoration-thickness: 4px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 24px; }
.steps li { position: relative; border-top: 1px solid var(--rule); padding-top: 22px; }
.steps li::before { content: ""; position: absolute; left: 0; top: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 2px rgba(236, 238, 237, 0.4); transition: box-shadow 0.3s, background 0.3s; }
.steps li:hover::before { background: var(--pen); box-shadow: 0 0 0 2px var(--pen); }
.steps a { text-decoration: none; font-family: var(--display); font-size: clamp(1.0625rem, 1.6vw, 1.375rem); font-weight: 500; letter-spacing: -0.01em; }

/* Terminal do hero */
.hero-in { max-width: 52%; position: relative; z-index: 2; }
.term { position: absolute; right: max(var(--pad), calc((100% - var(--max)) / 2)); top: 28%; width: min(40%, 520px); padding: 28px 30px; border: 1px solid var(--rule); border-radius: 14px; background: rgba(236, 238, 237, 0.03); font: 500 clamp(0.8125rem, 1.05vw, 0.9375rem)/1.9 var(--mono); color: var(--muted); }
.term p { white-space: nowrap; overflow: hidden; text-overflow: clip; }
.term i { font-style: normal; color: var(--pen); margin-right: 8px; }
.term b { display: inline-block; width: 11.5ch; font-weight: 500; color: var(--fg); }
.term .t5 { margin-top: 14px; color: var(--fg); }
.cur { display: inline-block; width: 0.6ch; height: 1.1em; margin-left: 3px; vertical-align: -0.2em; background: var(--pen); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.js .term p { opacity: 0; animation: tin 0.5s var(--ease) forwards; }
.t0 { animation-delay: 0.5s; } .t1 { animation-delay: 1.1s; } .t2 { animation-delay: 1.5s; } .t3 { animation-delay: 1.9s; } .t4 { animation-delay: 2.3s; } .t5 { animation-delay: 2.9s; }
@keyframes tin { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.num { font: 500 0.8125rem/1 var(--mono); letter-spacing: 0.1em; color: var(--pen); margin-bottom: 18px; }

/* Capítulos */
.chap {
  position: relative; isolation: isolate; min-height: min(100dvh, 980px); display: grid; grid-template-columns: repeat(12, 1fr);
  align-items: center; gap: 48px clamp(16px, 2vw, 32px); padding: clamp(88px, 14vh, 176px) max(var(--pad), calc((100% - var(--max)) / 2));
  border-top: 1px solid var(--rule);
}
.chap::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(55% 55% at var(--gx, 78%) 50%, var(--glow), transparent 72%); pointer-events: none; }
.g1 { --glow: rgba(40, 110, 175, 0.34); }
.g2 { --glow: rgba(50, 90, 230, 0.26); --gx: 22%; }
.g3 { --glow: rgba(200, 165, 112, 0.2); }
.g4 { --glow: rgba(255, 77, 31, 0.13); --gx: 22%; }
.copy { grid-column: 1 / 7; }
.stage { grid-column: 7 / 13; }
.flip .copy { grid-column: 7 / 13; order: 2; }
.flip .stage { grid-column: 1 / 7; order: 1; }
.verb { font-family: var(--display); font-size: clamp(2rem, 4.4vw, 4.25rem); font-weight: 600; line-height: 1; letter-spacing: -0.04em; overflow: hidden; padding-bottom: 0.1em; margin-bottom: 4px; }
.verb span { display: inline-block; }
.claim { font-family: var(--display); font-size: clamp(1.1875rem, 1.7vw, 1.5rem); font-weight: 500; line-height: 1.22; letter-spacing: -0.02em; max-width: 24ch; margin-top: 18px; text-wrap: balance; }
.proof-cap { margin-top: clamp(28px, 4vw, 48px); color: var(--muted); font-size: 0.9375rem; line-height: 1.55; max-width: 44ch; padding-top: 18px; border-top: 1px solid var(--rule); }
.proof-cap b { color: var(--fg); font-weight: 600; }
.pl { font: 500 0.6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; margin-right: 8px; color: var(--muted); }
.plink { display: flex; align-items: center; gap: 8px; width: fit-content; margin-top: 14px; color: var(--fg); font-weight: 500; text-decoration: none; }
.plink:hover { text-decoration: underline; text-decoration-color: var(--pen); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.arrow { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.4s var(--ease); }
.plink:hover .arrow { transform: translateX(5px); }

.stage { will-change: transform; transform: translate3d(0, var(--py, 0px), 0); }

/* Molduras */
.frame { position: relative; border-radius: 16px; overflow: hidden; }
.frame.tv { padding: clamp(5px, 0.9vw, 11px); background: #060809; box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(236, 238, 237, 0.14); }
.frame.flat { box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(236, 238, 237, 0.14); }
.screen { aspect-ratio: 16 / 9; border-radius: 11px; overflow: hidden; background: #07090a; }
.screen img, .screen video { display: block; width: 100%; height: 100%; object-fit: cover; }
.frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.4s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.1), transparent 45%); }
.frame:hover::after { opacity: 1; }
.phones img { display: block; width: 100%; max-width: 640px; height: auto; margin-inline: auto; filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.55)); }

/* Diagrama das fábricas */
.machine { width: 100%; }
.diagram { width: 100%; height: auto; overflow: visible; }
.d-row { font: 600 19px var(--display); fill: var(--fg); }
.d-stage { font: 500 14px var(--mono); fill: var(--muted); }
.d-line { stroke: var(--rule); stroke-width: 2; fill: none; }
.d-dot { fill: var(--fg); }
.d-dot.gate { fill: var(--pen); }
.d-gate { fill: none; stroke: var(--pen); stroke-width: 2; }
.packet { fill: var(--pen); offset-rotate: 0deg; animation: run 8.4s linear infinite; }
@keyframes run { from { offset-distance: 0%; } to { offset-distance: 100%; } }

/* Fecho */
.close { position: relative; padding: clamp(96px, 14vw, 200px) max(var(--pad), calc((100% - var(--max)) / 2)) clamp(96px, 12vw, 176px); border-top: 1px solid var(--rule); background: radial-gradient(60% 70% at 15% 100%, rgba(255, 77, 31, 0.12), transparent 70%); }
.close h2 { font-family: var(--display); font-size: clamp(2.5rem, 5.8vw, 5.25rem); font-weight: 600; line-height: 0.98; letter-spacing: -0.04em; max-width: 11ch; text-wrap: balance; }
.close p { margin-top: 28px; color: var(--muted); font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.45; max-width: 36ch; text-wrap: pretty; }
.mail { display: inline-block; margin-top: clamp(44px, 6vw, 88px); font-family: var(--display); font-size: clamp(1.15rem, 5.2vw, 4rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; text-decoration: none; padding-bottom: 14px; overflow-wrap: anywhere; transition: color 0.2s; }
html:not(.js) .mail { border-bottom: 3px solid var(--pen); }
.mail:hover { color: var(--pen); }
.close .who { margin-top: 36px; font-size: 1rem; }

/* Rodapé */
.foot { padding: 28px max(var(--pad), calc((100% - var(--max)) / 2)); display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; font-size: 0.875rem; color: var(--muted); border-top: 1px solid var(--rule); }
.foot a { text-underline-offset: 4px; }
.foot a:hover { color: var(--fg); }

/* Revelações: o conteúdo fica visível sem JS */
.js .rise { opacity: 0; transform: translateY(20px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .rise.in { opacity: 1; transform: none; }
.js .verb.rise { opacity: 1; transform: none; }
.js .verb span { transform: translateY(108%); transition: transform 1.1s var(--ease); }
.js .verb.in span { transform: none; }
.js .frame.rise { clip-path: inset(9% 7% 9% 7% round 22px); transform: scale(1.05); transition: opacity 1s var(--ease), transform 1.5s var(--ease), clip-path 1.5s var(--ease); }
.js .frame.rise.in { clip-path: inset(0 round 16px); transform: none; }

@media (max-width: 960px) {
  .chap { grid-template-columns: 1fr; min-height: 0; }
  .copy, .stage, .flip .copy, .flip .stage { grid-column: 1; order: initial; }
  .stage { order: 2; }
  .steps { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
  .hero-in { max-width: none; }
  .term { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js .rise, .js .verb span, .js .frame.rise { opacity: 1; transform: none; clip-path: none; }
  .stage { transform: none !important; }
  .js .term p { opacity: 1; animation: none; }
  .cur { animation: none; }
  .packet { animation: none; offset-distance: 50%; }
}
@media print { .plot, .bar { display: none; } }
