/* ==========================================================
   Nuvem61 Digital — estilos do site
   Tema claro/escuro via [data-theme] no <html>
   ========================================================== */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --text: #0e1525;
  --muted: #5b6476;
  --border: #e4e8f0;
  --primary: #1a5cff;
  --primary-hover: #0f4ae0;
  --primary-ink: #ffffff;
  --violet: #7b2ff7;
  --blue: #0062ff;
  --grad: linear-gradient(135deg, #7b2ff7 0%, #0062ff 100%);
  --tile: #eef0ff;
  --tile-ink: #5a3df5;
  --tag-own-bg: #f3ecff;
  --tag-own-ink: #6b28e0;
  --tag-client-bg: #e9f0ff;
  --tag-client-ink: #1450e6;
  --tag-community-bg: #e7f7ee;
  --tag-community-ink: #0b7a43;
  --ok: #0f9d58;
  --err: #d93025;
  --wa: #1faa53;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -6px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 64px -12px rgba(16, 24, 40, .28);
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 84px;
  --container: 1160px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a0e1a;
  --surface: #111729;
  --surface-2: #172036;
  --text: #e8ecf6;
  --muted: #9aa4ba;
  --border: #232c45;
  --primary: #3d7bff;
  --primary-hover: #5a8fff;
  --tile: #1c2346;
  --tile-ink: #a993ff;
  --tag-own-bg: #2a1d52;
  --tag-own-ink: #c7b2ff;
  --tag-client-bg: #16285a;
  --tag-client-ink: #9dbcff;
  --tag-community-bg: #123826;
  --tag-community-ink: #7fdcaa;
  --ok: #3ccf7f;
  --err: #ff6b5e;
  --wa: #35c46a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -6px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 64px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 200; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background-color .25s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 56px; width: auto; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 6px; }
.main-nav a {
  display: block; padding: 8px 14px; border-radius: 8px;
  font-size: 14.5px; font-weight: 500; color: var(--muted);
  transition: color .15s ease, background-color .15s ease;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.active { color: var(--text); font-weight: 600; }

.header-tools { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.lang-switch { gap: 2px; }
.lang-switch a { display: grid; place-items: center; padding: 5px 7px; border-radius: 999px; }
.lang-switch img {
  width: 22px; height: 15px; border-radius: 3px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); opacity: .5; filter: saturate(.7);
  transition: opacity .15s ease, filter .15s ease, transform .15s ease;
}
.lang-switch a:hover img { opacity: 1; filter: none; transform: scale(1.06); }
.lang-switch a[aria-current="true"] { background: var(--surface-2); }
.lang-switch a[aria-current="true"] img { opacity: 1; filter: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background-color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); }
.theme-toggle .i-moon { display: block; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
.menu-toggle { display: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer;
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-gradient { background: var(--grad); color: #fff; box-shadow: 0 8px 22px -8px rgba(91, 61, 245, .7); }
.btn-gradient:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .65; cursor: progress; }

/* ---------- Seções ---------- */
section { padding: 88px 0; }
.section-head { margin-bottom: 36px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; }
.section-head p { margin-top: 10px; color: var(--muted); font-size: 17px; }
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(123, 47, 247, .16), transparent 70%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; position: relative; }
.hero h1 { font-size: clamp(38px, 5.4vw, 60px); font-weight: 800; letter-spacing: -.035em; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { margin-top: 22px; font-size: 18px; color: var(--muted); max-width: 560px; }
.hero-cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { justify-self: end; width: 100%; max-width: 500px; animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- Serviços ---------- */
#servicos { padding-top: 40px; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  position: relative; display: block;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.service-card { padding: 26px 24px 28px; }
.icon-tile {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px;
  background: var(--tile); color: var(--tile-ink);
}
.icon-tile .icon { width: 24px; height: 24px; }
.icon-tile.lg { width: 64px; height: 64px; border-radius: 16px; background: var(--grad); color: #fff; }
.icon-tile.lg .icon { width: 32px; height: 32px; }
.card-chevron {
  position: absolute; top: 22px; right: 20px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted); transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.card:hover .card-chevron { background: var(--tile); color: var(--tile-ink); transform: translateX(2px); }
.card-chevron .icon { width: 16px; height: 16px; }
.service-card h3 { margin-top: 20px; font-size: 18px; font-weight: 700; }
.service-card p { margin-top: 8px; font-size: 14.5px; color: var(--muted); line-height: 1.55; }

/* ---------- Portfólio ---------- */
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-alt .card { background: var(--bg); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project-card { overflow: hidden; }
.project-card.is-hidden { display: none; }
.project-media { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; border-bottom: 1px solid var(--border); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.project-card:hover .project-media img { transform: scale(1.03); }
.project-media .tag { position: absolute; left: 14px; bottom: 14px; }
.tag { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.tag-own { background: var(--tag-own-bg); color: var(--tag-own-ink); border-color: color-mix(in srgb, var(--tag-own-ink) 30%, transparent); }
.tag-community { background: var(--tag-community-bg); color: var(--tag-community-ink); border-color: color-mix(in srgb, var(--tag-community-ink) 30%, transparent); }
.tag-client { background: var(--tag-client-bg); color: var(--tag-client-ink); border-color: color-mix(in srgb, var(--tag-client-ink) 30%, transparent); }
.project-info { padding: 20px 64px 24px 22px; }
.project-info h3 { font-size: 18px; font-weight: 700; }
.project-info p { margin-top: 6px; font-size: 14.5px; color: var(--muted); }
.project-card .card-chevron { top: auto; bottom: 30px; }

/* ---------- Contato ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 28px; align-items: start; }
.contact-list { display: grid; gap: 16px; }
.contact-item { display: flex; align-items: center; gap: 18px; padding: 20px 22px; }
.contact-item .icon-tile { width: 52px; height: 52px; }
.contact-item .icon-tile.wa { background: color-mix(in srgb, var(--wa) 14%, transparent); color: var(--wa); }
.contact-item strong { display: block; font-size: 16px; }
.contact-item span { display: block; font-size: 14px; color: var(--muted); word-break: break-word; }
.contact-item .card-chevron { position: static; margin-left: auto; }
.contact-item.static:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }

.form-card { padding: 28px; }
.form-card > h3 { font-size: 20px; font-weight: 700; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); font-size: 15px; transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.field input[readonly] { background: var(--surface-2); color: var(--muted); }
.phone-field { display: grid; grid-template-columns: 6.5em 4.5em 1fr; gap: 8px; }
.phone-field select, .phone-field input { width: 100%; }
.hp { position: absolute !important; left: -9999px !important; }
.form-status { margin-top: 12px; font-size: 14px; min-height: 1.4em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--err); }

/* ---------- Rodapé ---------- */
.site-footer { padding: 40px 0; border-top: 1px solid var(--border); background: var(--surface); }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-top .brand img { height: 46px; }
.footer-nav ul { display: flex; gap: 28px; }
.footer-nav a { font-size: 14px; color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.footer-bottom { margin-top: 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* ---------- Modais ---------- */
dialog.modal {
  width: min(880px, calc(100% - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  overflow: auto; overscroll-behavior: contain;
}
dialog.modal::backdrop { background: rgba(10, 14, 26, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .25s cubic-bezier(.2, .8, .2, 1); }
dialog.modal[open]::backdrop { animation: fade-in .25s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.modal-body { position: relative; padding: 32px; }
.modal-close {
  position: sticky; top: 0; float: right; margin: -18px -18px 0 8px; width: 38px; height: 38px; border-radius: 10px;
  border: 0; background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--muted); cursor: pointer; display: grid; place-items: center; z-index: 2;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-head { display: flex; gap: 18px; align-items: flex-start; padding-right: 36px; }
.modal-head h3 { font-size: 24px; font-weight: 800; }
.modal-head p, .modal-desc { margin-top: 8px; color: var(--muted); font-size: 15px; }
.modal h4 { font-size: 16px; font-weight: 700; margin: 26px 0 12px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; padding: 5px 0; }
.checklist .icon { width: 18px; height: 18px; color: var(--primary); margin-top: 3px; stroke-width: 2.6; }

.modal-service .modal-grid { display: grid; grid-template-columns: 1fr 240px; gap: 24px; align-items: end; }
.modal-service .modal-art { width: 240px; opacity: .95; }
.modal-project .modal-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start; }
.modal-project .modal-shot { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); aspect-ratio: 16 / 10; }
.modal-project .modal-shot img { width: 100%; height: 100%; object-fit: cover; }
.modal-project h3 { font-size: 26px; font-weight: 800; margin-top: 12px; }

.modal-actions { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions .btn-primary { flex: 1 1 260px; }
.share-group { display: flex; gap: 10px; }
.share-group .btn { padding: 12px 14px; }

.modal-form { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border); }
.modal-form h4 { margin-top: 0; }

.modal-whatsapp { width: min(420px, calc(100% - 32px)); }
.modal-whatsapp .modal-body { padding: 28px; }
.modal-whatsapp h3 { font-size: 20px; font-weight: 800; padding-right: 30px; }
.modal-whatsapp p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.wa-gate-options { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wa-gate-options .btn { width: 100%; justify-content: center; text-align: center; }
.modal-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* ---------- Aviso de cookies ---------- */
.cookie-banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 250;
  width: min(760px, calc(100% - 32px)); display: flex; align-items: center; gap: 20px;
  padding: 16px 18px 16px 22px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { font-size: 14px; color: var(--muted); flex: 1; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-actions .btn { padding: 10px 18px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--text); }
@media (max-width: 640px) {
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 12px; bottom: 12px; padding: 16px; }
  .cookie-actions .btn { flex: 1; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--surface); padding: 12px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 300; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animação de entrada ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1000px) {
  .services-grid, .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .modal-project .modal-grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; }
  .main-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; margin: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    padding: 10px 16px 16px; display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav a { padding: 12px 14px; font-size: 16px; }
  .header-tools { margin-left: auto; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-art { justify-self: center; max-width: 280px; }
  .hero { padding-top: 32px; }
  .modal-service .modal-grid { grid-template-columns: 1fr; }
  .modal-service .modal-art { display: none; }
}
@media (max-width: 640px) {
  :root { --header-h: 70px; }
  .container { padding: 0 16px; }
  section { padding: 64px 0; }
  .brand img { height: 42px; }
  .services-grid, .portfolio-grid { grid-template-columns: 1fr; }
  .lang-switch a { padding: 5px 5px; }
  .modal-body { padding: 24px 20px; }
  .modal-head { flex-direction: column; gap: 14px; }
  .modal-form .form-row { grid-template-columns: 1fr; }
  .phone-field { grid-template-columns: 1fr; }
  .footer-nav ul { gap: 18px; }
  dialog.modal { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
}
@media (max-width: 380px) {
  .lang-switch { display: none; }
  .main-nav .nav-lang { display: flex; }
}
.nav-lang { display: none; gap: 8px; margin-top: 8px; padding: 8px 14px; }
.nav-lang a { font-size: 14px; font-weight: 600; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
