/* ============================================================
   Ctrl + Zia — base.css
   Aesthetic-neutral foundation: reset, shared design tokens,
   layout primitives, accessibility helpers.
   Visual styling lives in minimal.css / brutal.css.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
[hidden] { display: none !important; }

/* ---------- Shared design tokens (aesthetic-neutral) ---------- */
:root {
  /* Type scale */
  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md: 1.125rem;    /* 18 */
  --fs-lg: 1.375rem;    /* 22 */
  --fs-xl: 1.75rem;     /* 28 */
  --fs-2xl: 2.25rem;    /* 36 */
  --fs-3xl: 3rem;       /* 48 */
  --fs-4xl: 3.75rem;    /* 60 */

  /* Spacing scale (4/8 rhythm) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Layout */
  --container: 1400px;
  --container-narrow: 820px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  /* Motion */
  --t-fast: 150ms;
  --t-med: 240ms;
  --t-slow: 420ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Fonts (system stacks = zero dependency, easy maintenance) */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Header height for scroll offset */
  --header-h: 68px;
}

/* ---------- Typography base ---------- */
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
}
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; }
p { line-height: 1.7; }
strong { font-weight: 700; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.section { padding-block: var(--sp-9); }
.section-sm { padding-block: var(--sp-7); }
.section-alt { background: var(--bg-alt); }

.section-head {
  max-width: var(--container-narrow);
  margin: 0 auto var(--sp-7);
  text-align: center;
}
.section-title { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
.section-desc { margin-top: var(--sp-3); font-size: var(--fs-md); color: var(--text-muted); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 2000;
  background: var(--bg);
  color: var(--text);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.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;
}

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

/* Smooth scroll with header offset (respect reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
:target { scroll-margin-top: calc(var(--header-h) + var(--sp-4)); }

/* ---------- Reusable icon helper ---------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--bg-alt); }
.icon-btn:active { transform: scale(0.94); }

/* Segmented control (language) */
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.seg-btn {
  padding: 0 var(--sp-3);
  border-radius: inherit;
  height: 36px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* Style select (design picker) — neutral base; themed per design */
.style-select-wrap { display: inline-flex; align-items: center; }
.style-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0 28px 0 10px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.style-select:hover { border-color: var(--accent); }
.style-select:focus-visible { outline-offset: 1px; }
.style-select option { font-family: var(--font-sans); font-weight: 500; }

/* Mobile: hide the header select (mobile-nav has its own) */
.mobile-style-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-2) 0;
}
.style-select-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
@media (max-width: 600px) {
  html { font-size: 17.5px; }
  .nav-actions .style-select-wrap { display: none; }
  .seg-btn { height: 44px; }
  .style-select { height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .sticky-cta-close { width: 44px; height: 44px; }
  .btn-sm { min-height: 44px; }
  .mobile-nav a { min-height: 44px; }
}

/* ============================================================
   PRICING (neutral base; themed per design)
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  align-items: stretch;
}
.price-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.price-featured { border-color: var(--accent); box-shadow: var(--shadow); }
.price-flag {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 999px;
  background: var(--accent); color: var(--primary-contrast); white-space: nowrap;
}
.price-name { font-size: var(--fs-lg); margin-bottom: var(--sp-3); }
.price-tag { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.price-from { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.price-value { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.price-range { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }
.price-list { margin: var(--sp-5) 0; display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.price-list li { position: relative; padding-left: var(--sp-5); font-size: var(--fs-sm); }
.pricing-note { text-align: center; margin-top: var(--sp-6); font-size: var(--fs-sm); color: var(--text-muted); }

/* ============================================================
   TESTIMONIALS (neutral base)
   ============================================================ */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.testi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-6);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: var(--sp-4);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.testi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.testi-card blockquote { font-size: var(--fs-md); line-height: 1.6; color: var(--text); flex: 1; }
.testi-author { display: flex; align-items: center; gap: var(--sp-3); }
.testi-avatar {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--primary-contrast);
  font-weight: 700; font-size: var(--fs-sm); letter-spacing: 0.02em;
}
.testi-meta { font-size: var(--fs-sm); line-height: 1.4; color: var(--text-muted); }
.testi-meta strong { color: var(--text); font-weight: 700; }
.testi-note { text-align: center; margin-top: var(--sp-6); font-size: var(--fs-sm); color: var(--text-muted); }

/* ============================================================
   PORTFOLIO DEMOS (neutral base overrides)
   ============================================================ */
.portfolio-grid-3 { grid-template-columns: repeat(3, 1fr); }
.pf-link { text-decoration: none; color: inherit; }
.pf-thumb-demo {
  flex-direction: column; gap: var(--sp-2);
  justify-content: flex-end; padding: var(--sp-5);
  aspect-ratio: 4 / 3;
}
.pf-thumb-tag {
  font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
  background: rgba(0,0,0,.5); color: #fff; align-self: flex-start;
}
.pf-thumb-name { font-size: var(--fs-lg); font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.pf-thumb-minimal { background: linear-gradient(135deg, #4f46e5, #818cf8); }
.pf-thumb-editorial { background: linear-gradient(135deg, #8b1e1e, #d4a574); }
.pf-thumb-brutal { background: linear-gradient(135deg, #ff3d00, #ffe600); }
.pf-cta { display: block; margin-top: var(--sp-3); font-weight: 600; font-size: var(--fs-sm); color: var(--accent); }

/* ============================================================
   LEAD FORM (neutral base)
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: var(--sp-6); align-items: start; }
.lead-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-6);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: var(--sp-4);
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-field { display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 600; }
.form-field span { color: var(--text); }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%; padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: var(--fs-base);
  font-weight: 400; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.form-field textarea { resize: vertical; min-height: 100px; }
.form-note { font-size: var(--fs-xs); color: var(--text-muted); }
.form-status { font-size: var(--fs-sm); font-weight: 600; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); }
.form-success { background: color-mix(in srgb, #22c55e 15%, transparent); color: #15803d; border: 1px solid #22c55e; }
.form-error { background: color-mix(in srgb, #ef4444 15%, transparent); color: #b91c1c; border: 1px solid #ef4444; }
.contact-side .contact-card { padding: var(--sp-6); }
.contact-side .contact-list { margin-top: 0; margin-bottom: var(--sp-5); }

@media (max-width: 960px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .testi-grid { grid-template-columns: 1fr; }
  .portfolio-grid-3 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .pricing-grid { gap: var(--sp-4); }
}

/* ============================================================
   MAINTENANCE (2-card grid)
   ============================================================ */
.pricing-grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 720px; margin-inline: auto; }

/* ============================================================
   BLOG TEASER (homepage)
   ============================================================ */
.blog-teaser-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.blog-teaser-more { text-align: center; margin-top: var(--sp-6); }
.blog-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-5);
  box-shadow: var(--shadow-sm); color: inherit;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.blog-card-thumb {
  aspect-ratio: 16 / 9; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; margin-bottom: var(--sp-3);
}
.blog-card-tag { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.blog-card h3 { font-size: var(--fs-md); letter-spacing: -0.01em; }
.blog-card p { font-size: var(--fs-sm); color: var(--text-muted); }
.blog-card-meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: auto; }
.blog-card-soon { opacity: 0.65; }
.blog-card-soon .blog-card-thumb { background: var(--surface-2); }
@media (max-width: 960px) { .blog-teaser-grid { grid-template-columns: 1fr; } }

/* ============================================================
   WHITE-LABEL BAND
   ============================================================ */
.whiteband {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-6); flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-7);
  box-shadow: var(--shadow-sm);
}
.whiteband-copy { max-width: 540px; }
.whiteband-copy .section-title { text-align: left; font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.whiteband-copy p { color: var(--text-muted); }
@media (max-width: 720px) { .whiteband { flex-direction: column; align-items: flex-start; } .whiteband .btn { width: 100%; } }

/* ============================================================
   STICKY CTA BAR (scroll-triggered, dismissible)
   ============================================================ */
.sticky-cta {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(max(var(--sp-4), env(safe-area-inset-bottom)) + 88px);
  z-index: 95; width: calc(100% - var(--sp-6)); max-width: 560px;
}
.sticky-cta-inner {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--text); color: var(--bg);
  border-radius: var(--radius); padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-lg);
}
.sticky-cta-text { flex: 1; font-weight: 600; font-size: var(--fs-sm); }
.sticky-cta-close { color: var(--bg); opacity: 0.7; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: opacity var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.sticky-cta-close:hover { opacity: 1; background: rgba(255,255,255,.15); }
.btn-sm { padding: 0.5rem 1rem; font-size: var(--fs-xs); }

/* When sticky CTA is visible, lift the floating WA button above it */
body.has-sticky .wa-float { bottom: calc(max(var(--sp-4), env(safe-area-inset-bottom)) + 152px); }

/* ============================================================
   COOKIE BANNER (LGPD)
   ============================================================ */
.cookie-banner {
  position: fixed; left: var(--sp-4); right: var(--sp-4);
  bottom: calc(max(var(--sp-4), env(safe-area-inset-bottom)) + 16px);
  z-index: 96; max-width: 480px;
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-4);
  box-shadow: var(--shadow-lg);
}
.cookie-text { flex: 1; min-width: 200px; font-size: var(--fs-sm); color: var(--text-muted); }
.cookie-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 720px) {
  .cookie-banner { right: var(--sp-4); left: var(--sp-4); max-width: none; }
}
