/*
 * Public site design system (layouts/site — body.gs). Everything is scoped to
 * .gs because stylesheet_link_tag :app also loads this file in the panel.
 *
 * Motion rules (Emil Kowalski's design-engineering guidelines):
 * - only transform/opacity/clip-path animate; never `transition: all`
 * - ease-out for enter, ease-in-out for on-screen movement, never ease-in
 * - UI feedback under 250ms; press = scale(.97); hover gated to real pointers
 * - nothing scrolls into view with a fade: motion only where it explains
 *   (hero entrance once, the chat demo) or confirms an action (press, menu)
 */

.gs {
  --paper: #faf8f3;
  --paper-2: #f2efe6;
  --card: #ffffff;
  --ink: #112c30;
  --ink-soft: #3b5356;
  --muted: #5b6e70;
  --line: rgba(17, 44, 48, 0.1);
  --leaf: #25d366;
  --leaf-hover: #1fc15b;
  --leaf-ink: #0b7a3e;
  --marker: #c8f4b0;
  --night: #0d2427;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --shadow-card: 0 0 0 1px rgba(17, 44, 48, 0.07), 0 1px 2px rgba(17, 44, 48, 0.04), 0 12px 32px -16px rgba(17, 44, 48, 0.16);
  --shadow-float: 0 0 0 1px rgba(17, 44, 48, 0.06), 0 2px 4px rgba(17, 44, 48, 0.04), 0 24px 56px -20px rgba(17, 44, 48, 0.28);

  background: var(--paper);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.gs [hidden] { display: none !important; }

.gs ::selection { background: var(--marker); color: var(--ink); }

.gs :focus { outline: none; }
.gs :focus-visible {
  outline: 2px solid var(--leaf-ink);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Type ---------- */
.gs .g-display {
  font-family: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}
.gs .g-h2 {
  font-family: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}
.gs .g-h3 {
  font-family: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.gs .g-lead { color: var(--ink-soft); text-wrap: pretty; }
.gs .g-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leaf-ink);
}
.gs .g-num { font-variant-numeric: tabular-nums; }

/* Highlighter stroke (marca-texto) behind a word */
.gs .g-mark {
  position: relative;
  white-space: nowrap;
  isolation: isolate;
}
.gs .g-mark::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.08em;
  right: -0.08em;
  bottom: 0.04em;
  height: 0.42em;
  background: var(--marker);
  border-radius: 0.12em 0.3em 0.18em 0.35em;
  transform: rotate(-0.6deg);
}

/* ---------- Buttons ---------- */
.gs .g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.375rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  user-select: none;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}
.gs .g-btn:active { transform: scale(0.97); }
.gs .g-btn-primary {
  background: var(--leaf);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 rgba(17, 44, 48, 0.12), 0 6px 16px -8px rgba(11, 122, 62, 0.55);
}
.gs .g-btn-dark { background: var(--ink); color: #fff; }
.gs .g-btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(17, 44, 48, 0.18); }
.gs .g-btn-on-dark { background: rgba(255, 255, 255, 0.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.gs .g-btn-lg { min-height: 56px; padding: 0.9rem 1.75rem; font-size: 1.0625rem; }
.gs .g-btn-sm { min-height: 40px; padding: 0.5rem 1rem; font-size: 0.9375rem; }

@media (hover: hover) and (pointer: fine) {
  .gs .g-btn-primary:hover { background: var(--leaf-hover); }
  .gs .g-btn-dark:hover { background: #0a1d20; }
  .gs .g-btn-ghost:hover { box-shadow: inset 0 0 0 1px rgba(17, 44, 48, 0.45); }
  .gs .g-btn-on-dark:hover { background: rgba(255, 255, 255, 0.14); }
  .gs .g-link:hover { text-decoration-color: currentColor; }
  .gs .g-row-link:hover { background: rgba(17, 44, 48, 0.035); }
  .gs .g-row-link:hover .g-arrow { transform: translateX(3px); }
  .gs .g-navlink:hover { color: var(--ink); }
}

.gs .g-link {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(17, 44, 48, 0.3);
  transition: text-decoration-color 160ms ease;
}
.gs .g-arrow { display: inline-block; transition: transform 200ms var(--ease-out); }
.gs .g-row-link { transition: background-color 160ms ease; }

/* ---------- Surfaces ---------- */
.gs .g-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow-card); }
.gs .g-card-dark { background: var(--ink); color: #fff; border-radius: 20px; box-shadow: 0 24px 56px -24px rgba(17, 44, 48, 0.55); }
.gs .g-section { padding-block: clamp(4.5rem, 10vw, 7.5rem); }
.gs .g-container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 640px) { .gs .g-container { padding-inline: 2rem; } }
.gs .g-rule { height: 1px; background: var(--line); }
.gs .g-dark { background: var(--ink); color: #f3f6f2; }
.gs .g-dark .g-lead { color: rgba(243, 246, 242, 0.74); }
.gs .g-dark .g-eyebrow { color: var(--leaf); }

.gs .g-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: rgba(17, 44, 48, 0.06);
  color: var(--ink-soft);
}
.gs .g-chip-hot { background: #fdecea; color: #a4241b; }
.gs .g-chip-ok { background: #e3f7e9; color: var(--leaf-ink); }

/* ---------- Header ---------- */
.gs .g-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.gs .g-header[data-scrolled="true"],
.gs .g-header[data-open="true"] {
  background: rgba(250, 248, 243, 0.86);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
@media (min-width: 1024px) { .gs .g-menu-btn, .gs .g-menu { display: none; } }
.gs .g-navlink { color: var(--ink-soft); font-weight: 500; transition: color 160ms ease; }
.gs .g-navlink[aria-current="page"] { color: var(--ink); }

.gs .g-menu {
  transform-origin: top center;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 0s;
}
.gs .g-menu[data-state="closed"] {
  opacity: 0;
  transform: translateY(-8px) scale(0.99);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease, visibility 0s linear 140ms;
}

/* ---------- Hero entrance (plays once) ---------- */
@keyframes g-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes g-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.gs .g-enter { animation: g-rise 560ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms + 40ms); }
.gs .g-enter .g-mark::before { animation: g-draw 650ms var(--ease-in-out) 420ms both; }

/* ---------- Chat demo ---------- */
.gs .g-phone {
  border-radius: 28px;
  background: #efeae2;
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.gs .g-phone-top { background: var(--ink); color: #fff; }
.gs .g-chat {
  background-color: #efeae2;
  background-image: radial-gradient(rgba(17, 44, 48, 0.06) 1px, transparent 1px);
  background-size: 18px 18px;
}
.gs .g-bubble {
  max-width: 86%;
  padding: 0.55rem 0.75rem 0.45rem;
  border-radius: 14px;
  font-size: 0.9375rem;
  line-height: 1.45;
  box-shadow: 0 1px 0.5px rgba(17, 44, 48, 0.13);
  text-wrap: pretty;
}
.gs .g-bubble-in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; transform-origin: 0% 100%; }
.gs .g-bubble-out { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 4px; transform-origin: 100% 100%; }
.gs .g-bubble time { display: block; text-align: right; font-size: 0.6875rem; color: rgba(17, 44, 48, 0.45); margin-top: 2px; }

.gs [data-chat-demo-target="log"] > * {
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.gs [data-chat-demo-target="log"] > [data-state="hidden"] {
  opacity: 0;
  transform: translateY(6px) scale(0.98);
}

.gs .g-typing { display: inline-flex; gap: 4px; padding: 0.7rem 0.8rem; }
.gs .g-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(17, 44, 48, 0.4);
  animation: g-dot 1s ease-in-out infinite;
}
.gs .g-typing span:nth-child(2) { animation-delay: 0.15s; }
.gs .g-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes g-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-3px); opacity: 1; } }

.gs .g-answer {
  flex: 1;
  min-height: 46px;
  border-radius: 12px;
  background: #fff;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(17, 44, 48, 0.12), 0 1px 1px rgba(17, 44, 48, 0.06);
  transition: transform 160ms var(--ease-out), box-shadow 160ms ease, background-color 160ms ease, opacity 200ms ease;
}
.gs .g-answer:active { transform: scale(0.97); }
.gs .g-answer:disabled { opacity: 0.5; }
.gs .g-answer[aria-pressed="true"] { opacity: 1; background: var(--ink); color: #fff; box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .gs .g-answer:not(:disabled):hover { box-shadow: 0 0 0 1.5px var(--ink), 0 1px 1px rgba(17, 44, 48, 0.06); }
}

/* ---------- Floating WhatsApp ---------- */
.gs .g-fab {
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.gs .g-fab:active { transform: scale(0.95); }
.gs .g-fab[data-state="hidden"] {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
}

/* ---------- FAQ ---------- */
.gs .g-faq summary { list-style: none; cursor: pointer; }
.gs .g-faq summary::-webkit-details-marker { display: none; }
.gs .g-faq .g-plus { transition: transform 200ms var(--ease-out); }
.gs .g-faq[open] .g-plus { transform: rotate(45deg); }

/* ---------- Timeline (um dia com o Gab) ---------- */
.gs .g-step-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--ink);
}
.gs .g-step-dot[data-accent] { background: var(--leaf); box-shadow: 0 0 0 2px var(--leaf-ink); }

/* ---------- Reduced motion: keep fades, drop movement ---------- */
@media (prefers-reduced-motion: reduce) {
  .gs .g-enter { animation: none; }
  .gs .g-enter .g-mark::before { animation: none; }
  .gs [data-chat-demo-target="log"] > [data-state="hidden"] { transform: none; }
  .gs [data-chat-demo-target="log"] > * { transition: opacity 160ms ease; }
  .gs .g-typing span { animation: none; opacity: 0.6; }
  .gs .g-menu, .gs .g-menu[data-state="closed"] { transform: none; }
  .gs .g-fab, .gs .g-fab[data-state="hidden"] { transform: none; }
  .gs .g-btn:active, .gs .g-answer:active { transform: none; }
}
