/* Rodrigo Lilla - Soluções Digitais. CSS nativo, sem dependências. */

/* ---------- Tokens ---------- */
:root {
  --bg: #f4f7fc;
  --bg-alt: #e9eff9;
  --surface: #ffffff;
  --text: #0b1730;
  --muted: #4b5b7a;
  --primary: #0b1730;          /* botões e superfícies fortes */
  --on-primary: #ffffff;
  --accent: #1f4fd8;           /* único acento cromático */
  --border: #d7e0f0;
  --positive: #0d7a4f;
  --panel: #0b1730;            /* painel do CTA final */
  --on-panel: #f2f6ff;
  --on-panel-muted: #b3c1e0;
  --shadow: 0 1px 2px rgb(11 23 48 / .05), 0 18px 40px -12px rgb(11 23 48 / .18);
  --shadow-lg: 0 2px 4px rgb(11 23 48 / .06), 0 40px 70px -24px rgb(11 23 48 / .32);

  /* forma: botões e chips em pílula; superfícies e mídia em 16px */
  --radius: 16px;
  --radius-pill: 999px;

  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(4.5rem, 9vw, 8rem);
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --maxw: 1240px;
  --header-h: 68px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;

  --z-header: 50;
  --z-menu: 60;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1226;
    --bg-alt: #0f1a35;
    --surface: #121d3b;
    --text: #e9effc;
    --muted: #a3b3d6;
    --primary: #eef3ff;
    --on-primary: #0b1730;
    --accent: #7ea2ff;
    --border: #22305a;
    --panel: #14265a;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 18px 40px -12px rgb(0 0 0 / .5);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .3), 0 40px 70px -24px rgb(0 0 0 / .65);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 100; background: var(--primary); color: var(--on-primary); padding: .7rem 1.1rem; border-radius: var(--radius-pill); text-decoration: none; }
.skip:focus { top: .75rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
section[id] { scroll-margin-top: calc(var(--header-h) - 8px); }

h1, h2, h3 { font-weight: 650; letter-spacing: -.028em; line-height: 1.08; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); }
h3 { font-size: 1.3rem; letter-spacing: -.015em; line-height: 1.25; }
.lead { color: var(--muted); font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem); line-height: 1.55; max-width: 58ch; text-wrap: pretty; }

.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: 0 1.5rem;
  border-radius: var(--radius-pill); border: 1.5px solid transparent;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .25s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn .ic { transition: transform .25s var(--ease); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-ghost { border-color: var(--border); background: transparent; color: var(--text); }
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-2px); }
  .btn-primary:hover .ic { transform: translateX(3px); }
  .btn-ghost:hover { border-color: var(--text); }
}
.btn-sm { min-height: 42px; padding: 0 1.15rem; font-size: .95rem; }

.tlink { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .28em; text-decoration-thickness: 1.5px; transition: text-decoration-color .2s; }
@media (hover: hover) { .tlink:hover { text-decoration-color: currentColor; } }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: var(--z-header);
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 0%, transparent);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, box-shadow .3s, height .3s var(--ease);
}
.header.is-scrolled {
  --header-h: 60px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-color: var(--border);
  box-shadow: 0 6px 20px -14px rgb(11 23 48 / .28);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  height: 60px;
}
.header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 1.21rem; letter-spacing: -.02em; }
.brand span { font-size: .84rem; color: var(--muted); letter-spacing: .02em; }
.nav { display: none; }
.nav a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 550; font-size: .98rem; padding: .5rem .2rem; position: relative; transition: color .2s; white-space: nowrap; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: .1rem; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav a:not(.btn):hover, .nav a[aria-current="true"] { color: var(--text); }
.nav a:not(.btn):hover::after, .nav a[aria-current="true"]::after { transform: scaleX(1); }
.header-cta { display: none; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius-pill); border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.menu-btn .ic { width: 1.4rem; height: 1.4rem; }
.menu-btn .i-x { display: none; }
.menu-btn[aria-expanded="true"] .i-x { display: block; }
.menu-btn[aria-expanded="true"] .i-menu { display: none; }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 auto 0; z-index: var(--z-menu);
  background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  padding: .75rem var(--gutter) 1.5rem; display: none;
}
.mobile-menu.is-open { display: block; }
.mobile-menu a:not(.btn) { display: flex; align-items: center; min-height: 52px; text-decoration: none; font-size: 1.15rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.mobile-menu .btn { width: 100%; margin-top: 1.25rem; }

@media (min-width: 900px) {
  .nav { display: flex; align-items: center; gap: 1.6rem; }
  .header-cta { display: inline-flex; }
  .menu-btn, .mobile-menu { display: none !important; }
}
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; opacity: 0; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress { opacity: 1; animation: progress linear both; animation-timeline: scroll(root); }
    @keyframes progress { to { transform: scaleX(1); } }
  }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(1.25rem, 3vw, 2.5rem) 0 var(--space-5); margin-top: calc(var(--header-h) * -1); padding-top: calc(var(--header-h) + clamp(1.5rem, 3vw, 3rem)); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 1.2rem + 3.2vw, 3.2rem); letter-spacing: -.035em; line-height: 1.04; }
.hero .lead { margin-top: 1.4rem; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }
.hero-actions .btn { flex: 1 1 auto; }

.hero-art { position: relative; aspect-ratio: 1.12; width: 100%; }
.layer { position: absolute; }
.layer img { width: 100%; }
.layer .win { border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border); background: var(--surface); }
.l1 { left: 0; top: 2%; width: 88%; }
.l2 { left: 6%; bottom: 0; width: 56%; }
.l3 { right: -3%; bottom: -3%; width: 38%; }

@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); }
  .hero-actions .btn { flex: 0 0 auto; }
  .hero { min-height: min(100dvh, 860px); display: flex; align-items: center; padding-bottom: var(--space-4); }
  .hero .wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); }
}
@media (max-height: 540px) and (orientation: landscape) {
  .hero { min-height: 0; padding-top: calc(var(--header-h) + 1rem); padding-bottom: 2rem; }
  .hero h1 { font-size: 2rem; }
  .hero .lead { margin-top: .8rem; font-size: 1rem; }
  .hero-actions { margin-top: 1.1rem; }
  .hero .wrap { grid-template-columns: 1.1fr 1fr; gap: 1.5rem; }
}

/* Motion do hero: entrada em camadas + paralaxe discreta (só sem reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; transform: translateY(22px); } }
  @keyframes enter { from { opacity: 0; transform: translateY(34px) scale(.97); } }
  .hero h1 { animation: rise .9s var(--ease) .05s both; }
  .hero .lead { animation: rise .9s var(--ease) .2s both; }
  .hero-actions { animation: rise .9s var(--ease) .32s both; }
  .l1 { animation: enter 1s var(--ease) .15s both; }
  .l2 { animation: enter 1s var(--ease) .35s both; }
  .l3 { animation: enter 1s var(--ease) .55s both; }
  @supports (animation-timeline: scroll()) {
    @keyframes par-a { to { transform: translateY(-3%); } }
    @keyframes par-b { to { transform: translateY(-9%); } }
    @keyframes par-c { to { transform: translateY(-15%); } }
    .l1 > img { animation: par-a linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    .l2 > img { animation: par-b linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    .l3 > img { animation: par-c linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
  }
}

/* ---------- Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
  .js .rv.in { opacity: 1; transform: none; }
}

/* ---------- Seções gerais ---------- */
.section { padding: var(--space-6) 0; }
.section-head { max-width: 46rem; margin-bottom: var(--space-4); }
.section-head .lead { margin-top: 1.1rem; }

/* ---------- Serviços (sticky stack) ---------- */
.services { background: var(--bg-alt); }
.svc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.svc-step { padding: 2rem 0; border-top: 1px solid var(--border); }
.svc-step:first-child { border-top: 0; padding-top: 0; }
.svc-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--accent); margin-bottom: 1.25rem; }
.svc-icon .ic { width: 1.6rem; height: 1.6rem; }
.svc-step p { color: var(--muted); margin-top: .8rem; max-width: 44ch; }
.svc-media { margin-top: 1.5rem; }
.svc-media img { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.svc-media.phone img { border: 0; box-shadow: none; max-width: 300px; margin-inline: auto; }
.svc-stage { display: none; }
.svc-note { color: var(--muted); font-size: .92rem; margin-top: 1.25rem; }

@media (min-width: 900px) {
  .svc-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
  .svc-steps { padding-bottom: 0; }
  .svc-step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; opacity: .38; transition: opacity .5s var(--ease); border-top: 0; padding: 0; }
  .svc-step.is-active { opacity: 1; }
  .svc-step:last-child { min-height: 42vh; }
  .svc-step h3 { font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem); }
  .svc-media { display: none; }
  .svc-stage { display: block; position: sticky; top: calc(var(--header-h) + 3vh); height: calc(100dvh - var(--header-h) - 6vh); }
  .stage-frame { position: relative; height: calc(100% - 2.2rem); }
  .stage-card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: transform .8s var(--ease), opacity .6s var(--ease); transform-origin: 50% 100%; will-change: transform, opacity; }
  .stage-card img { max-height: 100%; width: auto; max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .stage-card.phone img { border: 0; box-shadow: none; }
  .stage-card { transform: translateY(-8%) scale(.94); opacity: 0; z-index: 1; }
  .stage-card[data-future="1"] { transform: translateY(12%) scale(.97); }
  .stage-card.is-current { transform: none; opacity: 1; z-index: 2; }
  .svc-stage .svc-note { margin-top: .8rem; text-align: center; }
  .stage-dots { display: none; }
}
@media (min-width: 900px) and (max-height: 640px) { .svc-step { min-height: 80vh; } }
@media (prefers-reduced-motion: reduce) {
  .stage-card { transition: none; }
  .svc-step { transition: none; }
}

/* ---------- O que podemos construir (bento) ---------- */
.build-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.tile { display: flex; flex-direction: column; gap: .9rem; }
.tile .crop { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--bg-alt); border: 1px solid var(--border); flex: 1; min-height: 220px; aspect-ratio: 4 / 3; box-shadow: var(--shadow); }
.tile .crop img { position: absolute; max-width: none; width: var(--w, 100%); left: calc(var(--x, 0) * 1%); top: calc(var(--y, 0) * 1%); transition: transform .8s var(--ease); }
.tile .crop { background: linear-gradient(160deg, #e3ecff, #c9d8f7); }
.tile .crop img:not(.ph) { border-radius: 12px; box-shadow: var(--shadow-lg); }
.tile .crop.navy { background: linear-gradient(160deg, #1a2f66, #0b1730); border-color: #0b1730; }
.tile figcaption strong { display: block; font-size: 1.12rem; letter-spacing: -.01em; }
.tile figcaption span { color: var(--muted); font-size: .96rem; }
@media (hover: hover) { .tile:hover .crop img { transform: scale(1.035); } }
.build-note { margin-top: var(--space-3); color: var(--muted); font-size: .95rem; }
@media (min-width: 800px) {
  .build-grid { grid-template-columns: repeat(12, 1fr); grid-template-rows: auto auto; gap: var(--space-3) var(--space-3); }
  .t-a { grid-column: 1 / 8; }
  .t-c { grid-column: 8 / 13; grid-row: 1 / 3; }
  .t-b { grid-column: 1 / 5; }
  .t-d { grid-column: 5 / 8; }
  .t-a .crop { aspect-ratio: 16 / 9; }
  .t-b .crop, .t-d .crop { aspect-ratio: 4 / 3; min-height: 0; }
  .t-c .crop { aspect-ratio: auto; }
}
.tile .crop.phone-crop img { inset: 0; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; border-radius: 0; box-shadow: none; }
.tile .crop.phone-crop { min-height: 380px; }

/* ---------- Sobre + benefícios ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: center; }
.about-photo img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: var(--shadow); }
.about-text p { margin-top: 1.2rem; color: var(--muted); max-width: 52ch; }
.benefits { display: grid; gap: var(--space-3) var(--space-4); margin-top: var(--space-5); }
.benefit { border-top: 1.5px solid var(--text); padding-top: 1rem; }
.benefit h3 { font-size: 1.25rem; }
.benefit p { color: var(--muted); margin-top: .5rem; font-size: 1rem; }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); }
  .about-photo { order: 0; }
  .benefits { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 600px) and (max-width: 899px) { .benefits { grid-template-columns: 1fr 1fr; } }

/* ---------- Processo ---------- */
.process { background: var(--bg-alt); }
.steps { position: relative; display: grid; gap: 2rem; padding-left: 2.25rem; }
.steps::before, .steps-fill { content: ""; position: absolute; left: 7px; top: .4rem; bottom: .4rem; width: 2px; background: var(--border); border-radius: 2px; }
.steps-fill { background: var(--accent); transform: scaleY(var(--p, 0)); transform-origin: top; transition: transform .8s var(--ease); }
.step { position: relative; }
.step::before { content: ""; position: absolute; left: -2.25rem; top: .4rem; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-alt); border: 2px solid var(--border); transition: background-color .4s, border-color .4s; }
.step.on::before { background: var(--accent); border-color: var(--accent); }
.step h3 { font-size: 1.35rem; }
.step p { color: var(--muted); margin-top: .5rem; max-width: 34ch; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 2rem; padding: 3rem 0 0; }
  .steps::before, .steps-fill { left: 0; right: 0; top: 7px; bottom: auto; width: auto; height: 2px; }
  .steps-fill { transform: scaleX(var(--p, 0)); transform-origin: left; }
  .step::before { left: 0; top: -3rem; }
  .step { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .steps-fill { transition: none; } }

/* ---------- FAQ ---------- */
.faq .wrap { max-width: 860px; }
.faq-list { margin-top: var(--space-4); border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; text-align: left; background: none; border: 0; color: inherit; font: inherit; font-size: clamp(1.08rem, 1rem + .4vw, 1.3rem); font-weight: 600; letter-spacing: -.01em; padding: 1.35rem 0; min-height: 60px; cursor: pointer; }
.faq-q .ic { transition: transform .35s var(--ease); color: var(--accent); }
.faq-q[aria-expanded="true"] .ic { transform: rotate(45deg); }
.faq-a { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .4s var(--ease), visibility 0s .4s; }
.faq-a.is-open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .4s var(--ease), visibility 0s; }
.faq-a > div { overflow: hidden; }
.faq-a p { color: var(--muted); padding: 0 3rem 1.5rem 0; max-width: 62ch; }
@media (prefers-reduced-motion: reduce) { .faq-a, .faq-a.is-open, .faq-q .ic { transition: none; } }

/* ---------- CTA final ---------- */
.cta { padding: var(--space-5) 0 var(--space-6); }
.cta-panel { position: relative; overflow: hidden; isolation: isolate; background: var(--panel); color: var(--on-panel); border-radius: calc(var(--radius) * 1.5); padding: clamp(2rem, 6vw, 5rem); display: grid; gap: 2rem; }
.cta-panel::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("../img/foto-mesa-caderno.webp") right center / cover no-repeat; opacity: .5; }
.cta-panel::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--panel) 30%, color-mix(in srgb, var(--panel) 60%, transparent) 100%); }
.cta-panel h2 { max-width: 20ch; }
.cta-panel .lead { color: var(--on-panel-muted); }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }
.cta-panel .btn-primary { background: #ffffff; color: #0b1730; }
.cta-mail { color: var(--on-panel); font-weight: 550; }
@media (max-width: 560px) { .cta-actions .btn { width: 100%; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: var(--space-4) 0 var(--space-5); }
.footer .wrap { display: grid; gap: 1.5rem; }
.footer strong { display: block; font-size: 1.1rem; letter-spacing: -.02em; }
.footer span { color: var(--muted); font-size: .95rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 800px) { .footer .wrap { grid-template-columns: 1fr auto auto; align-items: center; gap: 3rem; } }
