@layer tokens, reset, base, components, motion, utilities;

@layer tokens {
  :root {
    --ds-red-primary: #D31118;
    --ds-red-hover: #C1272D;
    --ds-red-surface: #FEF2F2;
    --ds-orange: #F37021;
    --ds-orange-bg: #FFF4EC;
    --ds-orange-surface: #FFF7ED;
    --ds-orange-text-aa: #9E3E00;
    --ds-green-lime: #9ACA3C;
    --ds-green-text-aa: #1E7E34;
    --ds-purple: #522D80;
    --ds-purple-surface: #F5F3FF;
    --ds-cyan: #00AEEF;
    --ds-cyan-text-aa: #006B94;
    --ds-ink: #231F20;
    --ds-ink-secondary: #52525B;
    --ds-bg-page: #FAFAFA;
    --ds-bg-surface: #FFFFFF;
    --ds-border: #E4E4E7;

    /* Semânticos — superfícies (60 %) */
    --sf-canvas: var(--ds-bg-page);
    --sf-card: var(--ds-bg-surface);
    --sf-soft: #F6F5F3;
    --sf-glass: rgba(255, 255, 255, 0.78);
    --sf-ink: var(--ds-ink);

    /* Semânticos — estrutura e texto (30 %) */
    --tx-primary: var(--ds-ink);
    --tx-secondary: var(--ds-ink-secondary);
    --tx-muted: #66666E;
    --tx-on-ink: #FFFFFF;
    --bd-subtle: rgba(35, 31, 32, 0.08);
    --bd-default: var(--ds-border);
    --bd-strong: rgba(35, 31, 32, 0.18);
    --bd-warning: #F8C9B0;

    /* Semânticos — interação e estado (10 %) */
    --int-primary: var(--ds-red-primary);
    --int-primary-hover: var(--ds-red-hover);
    --int-primary-surface: var(--ds-red-surface);
    --int-focus: var(--ds-purple);
    --int-ring: rgba(82, 45, 128, 0.28);
    --st-success: var(--ds-green-text-aa);
    --st-info: var(--ds-cyan-text-aa);
    --st-info-surface: #EAF6FC;
    --st-warning: var(--ds-orange-text-aa);
    --st-warning-surface: var(--ds-orange-surface);
    --st-error: var(--ds-red-primary);

    /* Tipografia (pilha de sistema — CSP font-src 'self' + P2) */
    --font-sans: system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: var(--font-sans);
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --type-display: clamp(2.5rem, 1.9rem + 3.4vw, 4.6rem);
    --type-h2: clamp(1.9rem, 1.4rem + 1.8vw, 2.75rem);
    --type-h3: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    --type-lead: clamp(1.125rem, 1.05rem + 0.5vw, 1.375rem);
    --type-body: 1.0625rem;   /* 17 px */
    --type-small: 0.9375rem;  /* 15 px */
    --type-caption: 0.875rem; /* 14 px — mínimo absoluto */
    --leading-tight: 1.05;
    --leading-snug: 1.25;
    --leading-body: 1.6;
    --tracking-display: -0.035em;
    --tracking-heading: -0.02em;
    --tracking-eyebrow: 0.08em;

    /* Espaço e ritmo */
    --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
    --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
    --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;
    --section-pad: clamp(4rem, 8vw, 7rem);
    --container: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --header-h: 76px;

    /* Forma, elevação e luz */
    --radius-sm: 10px; --radius-md: 16px; --radius-lg: 24px; --radius-xl: 32px; --radius-pill: 999px;
    --shadow-ambient: 0 1px 2px rgba(35, 31, 32, 0.04), 0 24px 48px -28px rgba(35, 31, 32, 0.18);
    --shadow-hover: 0 2px 4px rgba(35, 31, 32, 0.05), 0 32px 56px -28px rgba(35, 31, 32, 0.24);
    --sh-btn: 0 10px 24px -14px rgba(211, 17, 24, 0.55);
    --sh-btn-hover: 0 16px 28px -14px rgba(211, 17, 24, 0.6);
    --sh-fab: 0 14px 32px -12px rgba(211, 17, 24, 0.6);
    --ring-focus: 0 0 0 4px var(--int-ring);
    --ring-online: 0 0 0 3px rgba(30, 126, 52, 0.18);
    --glow-laranja: radial-gradient(closest-side, rgba(243, 112, 33, 0.20), rgba(243, 112, 33, 0.06) 45%, transparent 72%);
    --glow-roxo: radial-gradient(closest-side, rgba(82, 45, 128, 0.14), rgba(82, 45, 128, 0.04) 45%, transparent 72%);
    --glow-ciano: radial-gradient(closest-side, rgba(0, 174, 239, 0.13), rgba(0, 174, 239, 0.04) 45%, transparent 72%);
    --brand-gradient: linear-gradient(90deg, #F37021 0 20%, #D31118 20% 40%, #522D80 40% 60%, #9ACA3C 60% 80%, #00AEEF 80% 100%);

    /* Movimento */
    --dur-enter: 260ms;
    --dur-exit: 160ms;
    --dur-ambient: 40s;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    /* Camadas z */
    --z-header: 30; --z-nav: 40; --z-fab: 50; --z-chat: 60; --z-skip: 100;

    color-scheme: light;
    interpolate-size: allow-keywords;
  }
}

/* 2. Reset */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
  body { min-height: 100dvh; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  img, svg { display: block; max-width: 100%; }
  picture { display: contents; }
  button, input { font: inherit; color: inherit; }
  ul[class], ol[class] { list-style: none; }
  a { color: inherit; }
  summary { list-style: none; cursor: pointer; }
  summary::-webkit-details-marker { display: none; }
  fieldset { border: 0; min-inline-size: 0; }
  legend { padding: 0; }
}

/* 3. Base */
@layer base {
  body {
    font-family: var(--font-sans);
    font-size: var(--type-body);
    line-height: var(--leading-body);
    color: var(--tx-primary);
    background: var(--sf-canvas);
    overflow-x: clip;
    overflow-wrap: anywhere; /* palavras longas (URLs, 'Micropigmentação') quebram antes de criar scroll horizontal a 200 % */
  }
  h1, h2, h3 { font-family: var(--font-display); letter-spacing: var(--tracking-heading); text-wrap: balance; line-height: var(--leading-snug); }
  p { max-width: 68ch; }
  a:not([class]) { color: var(--int-primary); text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
  a:not([class]):hover { color: var(--int-primary-hover); text-decoration-thickness: 2px; }
  :focus-visible { outline: 3px solid var(--int-focus); outline-offset: 3px; border-radius: var(--radius-sm); }
  ::selection { background: var(--ds-red-surface); color: var(--ds-ink); }
  .container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
  .eyebrow {
    font-size: var(--type-caption); font-weight: 700; letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase; color: var(--tx-secondary); margin-bottom: var(--space-3);
  }
  .skip-link {
    position: absolute; top: var(--space-2); left: var(--space-2); z-index: var(--z-skip);
    padding: var(--space-3) var(--space-5); background: var(--sf-ink); color: var(--tx-on-ink);
    border-radius: var(--radius-pill); text-decoration: none; font-weight: 700;
    translate: 0 -200%; transition: translate var(--dur-exit) var(--ease-out);
  }
  .skip-link:focus { translate: 0 0; }
}

/* 4. Componentes */
@layer components {

  /* Ícones — grid 24, traço 1,75, cantos redondos */
  .icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
  .icon--trail { margin-left: var(--space-2); }
  .icon--chevron { transition: rotate var(--dur-enter) var(--ease-out); }

  /* Botões */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
    min-height: 48px; padding: 0.75rem 1.5rem; border-radius: var(--radius-pill);
    font-weight: 700; font-size: var(--type-body); line-height: 1.2; text-decoration: none;
    border: 1.5px solid transparent; cursor: pointer; touch-action: manipulation; text-align: center; max-width: 100%; min-width: 0;
    transition: background-color var(--dur-exit) var(--ease-out), color var(--dur-exit) var(--ease-out),
      border-color var(--dur-exit) var(--ease-out), box-shadow var(--dur-enter) var(--ease-out), translate var(--dur-enter) var(--ease-out);
  }
  .btn--primary { background: var(--int-primary); color: var(--tx-on-ink); box-shadow: var(--sh-btn); }
  .btn--primary:hover { background: var(--int-primary-hover); translate: 0 -2px; box-shadow: var(--sh-btn-hover); }
  .btn--ghost { background: var(--sf-card); color: var(--tx-primary); border-color: var(--bd-default); }
  .btn--ghost:hover { border-color: var(--bd-strong); translate: 0 -2px; box-shadow: var(--shadow-ambient); }
  .btn--text { min-height: 44px; padding: 0.4rem 0.8rem; background: transparent; color: var(--tx-secondary); font-size: var(--type-small); }
  .btn--text:hover { background: var(--sf-soft); color: var(--tx-primary); }
  .btn--large { min-height: 56px; padding: 0.95rem 1.9rem; font-size: var(--type-lead); }
  .btn--compact { min-height: 44px; padding: 0.55rem 1.1rem; font-size: var(--type-small); white-space: nowrap; }
  .btn:active { translate: 0 0; }
  .btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
  .btn[aria-busy="true"] { opacity: 0.7; pointer-events: none; }

  /* Badges e chips */
  .badge {
    display: inline-flex; align-items: center; gap: var(--space-2); padding: 0.3rem 0.8rem; line-height: 1.35;
    border-radius: var(--radius-sm); font-size: var(--type-caption); font-weight: 800; letter-spacing: 0.04em;
  }
  .badge--novo { background: var(--int-primary); color: var(--tx-on-ink); }
  .chip {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0.6rem 1.05rem;
    border-radius: var(--radius-pill); border: 1.5px solid var(--bd-default); background: var(--sf-card);
    color: var(--tx-primary); font-size: var(--type-small); font-weight: 600; cursor: pointer; touch-action: manipulation;
    transition: background-color var(--dur-exit), border-color var(--dur-exit), color var(--dur-exit), translate var(--dur-enter) var(--ease-out);
  }
  .chip:hover { border-color: var(--int-primary); background: var(--int-primary-surface); color: var(--int-primary); translate: 0 -1px; }
  .chip--novo { border-color: var(--bd-warning); background: var(--st-warning-surface); color: var(--st-warning); }
  .chip--novo:hover { border-color: var(--ds-orange); }
  .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-success); display: inline-block; margin-right: var(--space-2); }
  .dot--online { box-shadow: var(--ring-online); }

  /* Cards genéricos */
  .card {
    background: var(--sf-card); border: 1px solid var(--bd-subtle); border-radius: var(--radius-lg);
    padding: var(--space-8); box-shadow: var(--shadow-ambient); display: flex; flex-direction: column; gap: var(--space-4);
  }
  .card__title { font-size: var(--type-h3); }
  .card .btn { align-self: flex-start; margin-top: auto; }
  .card__status { font-size: var(--type-small); color: var(--st-success); min-height: 1.5em; }

  /* Cabeçalho (vidro) */
  .site-header { position: sticky; top: 0; z-index: var(--z-header); background: var(--sf-glass); backdrop-filter: blur(16px); border-bottom: 1px solid var(--bd-subtle); }
  .brand-stripe { height: 3px; background: var(--brand-gradient); }
  .site-header__inner { display: flex; align-items: center; gap: var(--space-6); min-height: var(--header-h); }
  .brand { display: inline-flex; align-items: center; min-height: 44px; border-radius: var(--radius-sm); }
  .brand__logo { height: 48px; width: auto; }
  .site-nav { margin-left: auto; }
  .site-nav__list { display: flex; gap: var(--space-1); }
  .site-nav__cta { display: none; }
  .site-nav__link {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-pill);
    font-weight: 600; font-size: var(--type-small); color: var(--tx-secondary); text-decoration: none;
    transition: background-color var(--dur-exit), color var(--dur-exit);
  }
  .site-nav__link:hover, .site-nav__link.is-current { background: var(--sf-soft); color: var(--tx-primary); }
  .nav-toggle { display: none; align-items: center; gap: var(--space-2); min-height: 44px; min-width: 44px; padding: 0 var(--space-3); border: 1.5px solid var(--bd-default); border-radius: var(--radius-pill); background: var(--sf-card); font-weight: 600; font-size: var(--type-small); cursor: pointer; margin-left: auto; }
  .nav-toggle__close { display: none; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }

  /* Hero com aurora */
  .hero { position: relative; isolation: isolate; padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(3rem, 7vw, 6rem); overflow: clip; }
  .aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
  .aurora__glow { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; opacity: 0.7; }
  .aurora__glow--laranja { top: -30vmax; left: -18vmax; background: var(--glow-laranja); }
  .aurora__glow--roxo { top: -10vmax; right: -22vmax; background: var(--glow-roxo); }
  .aurora__glow--ciano { bottom: -36vmax; left: 30%; background: var(--glow-ciano); }
  .hero__inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--space-12); align-items: center; }
  .hero__title { font-size: var(--type-display); font-weight: 800; letter-spacing: var(--tracking-display); line-height: var(--leading-tight); max-width: 14ch; }
  .hero__accent { font-style: normal; color: var(--int-primary); }
  .hero__lead { font-size: var(--type-lead); color: var(--tx-secondary); margin-top: var(--space-6); max-width: 52ch; }
  .hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
  .facts { display: flex; flex-wrap: wrap; gap: var(--space-6) var(--space-10); margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid var(--bd-subtle); }
  .fact { display: grid; gap: 2px; }
  .fact strong { font-size: 1.5rem; font-weight: 800; letter-spacing: var(--tracking-heading); font-variant-numeric: tabular-nums; }
  .fact span { font-size: var(--type-small); color: var(--tx-secondary); max-width: 20ch; }
  .hero__art { max-width: 520px; margin-inline: auto; }
  .constelacao { width: 100%; height: auto; aspect-ratio: 1; }

  /* Jornadas (seções) */
  .journey { padding: var(--section-pad) 0; scroll-margin-top: calc(1.5rem - var(--section-pad)); /* a âncora aterrissa no conteúdo, não no respiro */ }
  .journey--soft { background: var(--sf-soft); }
  .journey__head { max-width: 760px; margin-bottom: var(--space-12); }
  .journey__title { font-size: var(--type-h2); font-weight: 800; }
  .journey__lead { font-size: var(--type-lead); color: var(--tx-secondary); margin-top: var(--space-4); }

  /* Passos */
  .steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); counter-reset: passo; }
  .step {
    counter-increment: passo; position: relative; background: var(--sf-card); border: 1px solid var(--bd-subtle);
    border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-ambient); display: grid; gap: var(--space-3); align-content: start;
  }
  .step::before { content: counter(passo, decimal-leading-zero) / ""; position: absolute; top: var(--space-5); right: var(--space-6); font-family: var(--font-mono); font-size: var(--type-caption); font-weight: 700; color: var(--tx-muted); }
  .step__icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--int-primary-surface); color: var(--int-primary); }
  .step__title { font-size: 1.125rem; font-weight: 700; }
  .step p { font-size: var(--type-small); color: var(--tx-secondary); }

  /* Assistente */
  .notice { margin-top: var(--space-6); padding: var(--space-5); border-radius: var(--radius-md); background: var(--st-warning-surface); border: 1px solid var(--bd-warning); display: grid; gap: var(--space-3); justify-items: start; }
  .notice p { font-size: var(--type-small); color: var(--tx-primary); }
  .chips { margin-top: var(--space-6); display: grid; gap: var(--space-3); }
  .chips__label { font-size: var(--type-small); font-weight: 700; color: var(--tx-secondary); }
  .chips__group { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .chips__more { border-top: 1px solid var(--bd-subtle); padding-top: var(--space-3); }
  .chips__summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-weight: 700; font-size: var(--type-small); color: var(--tx-secondary); border-radius: var(--radius-sm); }
  .chips__summary:hover { color: var(--tx-primary); }
  .chips__more[open] .icon--chevron { rotate: 180deg; }
  .chips__more .chips__group { padding-top: var(--space-3); }
  .chat__log { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-1); }
  .msg { max-width: 92%; padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); font-size: var(--type-body); line-height: 1.5; }
  .msg--bot { align-self: flex-start; background: var(--sf-card); border: 1px solid var(--bd-subtle); border-bottom-left-radius: 6px; }
  .msg--user { align-self: flex-end; background: var(--sf-ink); color: var(--tx-on-ink); border-bottom-right-radius: 6px; }
  .msg__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
  .msg__avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--int-primary); color: var(--tx-on-ink); font-size: 0.7rem; font-weight: 800; }
  .msg__tag { font-size: var(--type-caption); font-weight: 700; color: var(--st-info); background: var(--st-info-surface); padding: 0.15rem 0.6rem; border-radius: var(--radius-pill); }
  .msg__tag--novo { color: var(--st-warning); background: var(--st-warning-surface); }
  .msg__title { font-weight: 700; margin-bottom: var(--space-1); }
  .msg__body { white-space: pre-line; overflow-wrap: anywhere; }
  .msg__note { margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--bd-subtle); font-size: var(--type-caption); color: var(--tx-secondary); }
  .msg__link { font-size: var(--type-caption); }
  .chat__typing { display: inline-flex; gap: 5px; padding: var(--space-3) var(--space-4); background: var(--sf-card); border: 1px solid var(--bd-subtle); border-radius: var(--radius-md); width: max-content; }
  .chat__typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--tx-muted); }
  .chat__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .chat__label { font-size: var(--type-small); font-weight: 700; color: var(--tx-secondary); }
  .chat__field { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; background: var(--sf-card); border: 1.5px solid var(--bd-default); border-radius: var(--radius-pill); padding: 4px 4px 4px var(--space-5); transition: border-color var(--dur-exit), box-shadow var(--dur-exit); }
  .chat__field:focus-within { border-color: var(--int-focus); box-shadow: var(--ring-focus); }
  .chat__field:has(.chat__input[aria-invalid="true"]) { border-color: var(--st-error); background: var(--int-primary-surface); }
  .chat__input { flex: 1 1 10ch; min-width: 0; min-height: 44px; border: 0; background: transparent; outline: none; font-size: var(--type-body); }
  .chat__input::placeholder { color: var(--tx-muted); opacity: 1; }
  .chat__send { min-height: 44px; padding: 0.5rem 1.25rem; }
  .chat__hint { font-size: var(--type-caption); color: var(--tx-secondary); }


  /* Assistente: card de abertura na jornada + widget flutuante */
  .assist { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-8); margin-top: var(--space-16); background: var(--sf-card); border: 1px solid var(--bd-subtle); border-radius: var(--radius-xl); padding: var(--space-10); box-shadow: var(--shadow-ambient); }
  .assist__title { font-size: var(--type-h2); font-weight: 800; }
  .assist__lead { color: var(--tx-secondary); margin-top: var(--space-3); }
  .assist__actions { display: grid; gap: var(--space-3); align-content: center; justify-items: start; }
  .assist__hint { font-size: var(--type-small); font-weight: 700; color: var(--tx-secondary); }
  .chat-fab { position: fixed; right: 16px; bottom: 16px; z-index: var(--z-fab); display: inline-flex; align-items: center; gap: var(--space-2); min-height: 56px; padding: 0 1.25rem 0 1rem; border: 0; border-radius: var(--radius-pill); background: var(--int-primary); color: var(--tx-on-ink); font-weight: 700; font-size: var(--type-body); cursor: pointer; box-shadow: var(--sh-fab); transition: background-color var(--dur-exit), translate var(--dur-enter) var(--ease-out); }
  .chat-fab:hover { background: var(--int-primary-hover); translate: 0 -2px; }
  .chat-fab[aria-expanded="true"] { display: none; }
  .chatw { position: fixed; right: 16px; bottom: 16px; z-index: var(--z-chat); width: min(440px, calc(100vw - 32px)); height: min(720px, calc(100dvh - 32px)); display: flex; flex-direction: column; background: var(--sf-card); border: 1px solid var(--bd-subtle); border-radius: var(--radius-xl); box-shadow: var(--shadow-hover); overflow: clip; }
  .chatw__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--bd-subtle); }
  .chatw__head .msg__avatar { width: 36px; height: 36px; font-size: 0.8rem; }
  .chatw__id { min-width: 0; }
  .chatw__title { font-size: 1.125rem; font-weight: 800; letter-spacing: var(--tracking-heading); }
  .chatw__sub { display: inline-flex; align-items: center; font-size: var(--type-caption); font-weight: 700; color: var(--tx-secondary); }
  .chatw__close { margin-left: auto; flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--bd-default); background: var(--sf-card); color: var(--tx-primary); cursor: pointer; }
  .chatw__close:hover { border-color: var(--bd-strong); background: var(--sf-soft); }
  .chatw__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); background: var(--sf-soft); scrollbar-width: thin; }
  .chatw__body .chips { margin-top: 0; }
  .chatw__form { padding: var(--space-3) var(--space-5) var(--space-4); border-top: 1px solid var(--bd-subtle); background: var(--sf-card); }
  .chatw__clear { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--int-primary); cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
  body.chat-open .site-footer { padding-bottom: var(--space-10); }
  .site-footer { padding-bottom: calc(var(--space-10) + 72px); }

  /* Onde doar */
  .places { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-10); margin-top: var(--space-16); padding-top: var(--space-12); border-top: 1px solid var(--bd-subtle); align-items: start; }
  .places__title { font-size: var(--type-h3); font-weight: 800; }
  .places__copy { display: grid; gap: var(--space-4); justify-items: start; }
  .places__copy p { color: var(--tx-secondary); }
  .places__list { display: grid; gap: var(--space-3); }
  .place { display: grid; gap: 2px; padding: var(--space-4) var(--space-5); background: var(--sf-card); border: 1px solid var(--bd-subtle); border-radius: var(--radius-md); }
  .place strong { font-weight: 700; }
  .place span { font-size: var(--type-small); color: var(--tx-secondary); }
  .place--main { border-color: var(--bd-strong); box-shadow: var(--shadow-ambient); gap: var(--space-1); }
  .place__note { font-size: var(--type-caption); }
  .place__phone { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; margin-top: var(--space-1); font-weight: 700; color: var(--int-primary); text-decoration: none; }
  .place__phone:hover { text-decoration: underline; text-underline-offset: 0.2em; }
  .contact-list { display: grid; gap: var(--space-1); }
  .contact-list__link { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 44px; font-weight: 600; color: var(--tx-primary); text-decoration: none; }
  .contact-list__link:hover { color: var(--int-primary); text-decoration: underline; text-underline-offset: 0.2em; }
  .contact-list__link--featured { display: flex; width: 100%; padding: var(--space-2) var(--space-4); margin-bottom: var(--space-1); border: 1.5px solid var(--ds-purple); border-radius: var(--radius-md); background: var(--ds-purple-surface); color: var(--ds-purple); font-weight: 700; transition: translate var(--dur-enter) var(--ease-out), box-shadow var(--dur-enter) var(--ease-out), border-color var(--dur-exit); }
  .contact-list__link--featured:hover { color: var(--int-primary); border-color: var(--int-primary); box-shadow: var(--shadow-ambient); translate: 0 -1px; text-decoration: none; }
  .contact-list__badge { margin-left: auto; padding: 0.15rem 0.55rem; border-radius: var(--radius-pill); background: var(--ds-purple); color: var(--tx-on-ink); font-size: var(--type-caption); font-weight: 700; }
  .contact-list__link--muted { margin-top: var(--space-1); padding-top: var(--space-2); border-top: 1px solid var(--bd-subtle); font-size: var(--type-small); font-weight: 500; color: var(--tx-secondary); }
  .contact-list__note { font-size: var(--type-caption); color: var(--tx-secondary); }

  /* Grupos WhatsApp */
  .groups { scroll-margin-top: 1rem; }
  .groups__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-8); align-items: end; margin-bottom: var(--space-4); }
  .groups__title { font-size: var(--type-h3); font-weight: 800; }
  .groups__lead { color: var(--tx-secondary); margin-top: var(--space-3); }
  .filter { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); padding: 4px; background: var(--sf-card); border: 1px solid var(--bd-subtle); border-radius: var(--radius-pill); }
  .filter__btn { min-height: 44px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--tx-secondary); font-weight: 600; font-size: var(--type-small); cursor: pointer; touch-action: manipulation; transition: background-color var(--dur-exit), color var(--dur-exit); }
  .filter__btn:hover { color: var(--tx-primary); }
  .filter__btn.is-active { background: var(--sf-ink); color: var(--tx-on-ink); }
  .filter__status { font-size: var(--type-small); color: var(--tx-secondary); margin-bottom: var(--space-5); }
  .groups__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
  .group__card {
    display: grid; gap: var(--space-2); height: 100%; padding: var(--space-5); text-decoration: none;
    background: var(--sf-card); border: 1px solid var(--bd-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-ambient);
    transition: translate var(--dur-enter) var(--ease-out), box-shadow var(--dur-enter) var(--ease-out), border-color var(--dur-exit);
  }
  .group__card:hover { translate: 0 -3px; box-shadow: var(--shadow-hover); border-color: var(--bd-strong); }
  .group__type { font-size: 2.25rem; font-weight: 800; letter-spacing: var(--tracking-display); line-height: 1; color: var(--int-primary); font-variant-numeric: tabular-nums; }
  .group--neg .group__type { color: var(--st-info); }
  .group__tag { font-size: var(--type-caption); font-weight: 700; color: var(--tx-secondary); }
  .group__info { font-size: var(--type-small); color: var(--tx-secondary); line-height: 1.45; }
  .group__cta { display: inline-flex; align-items: center; margin-top: var(--space-2); font-weight: 700; color: var(--st-success); font-size: var(--type-small); }
  .group.is-match .group__card { border-color: var(--st-success); }
  .duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); margin-top: var(--space-12); }
  .support { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-8); align-items: start; }
  .support__title { font-size: var(--type-h3); font-weight: 800; margin-bottom: var(--space-4); }
  .support__list { display: grid; gap: var(--space-3); }
  .support__list li { padding: var(--space-4) var(--space-5); background: var(--sf-card); border: 1px solid var(--bd-subtle); border-radius: var(--radius-md); color: var(--tx-secondary); font-size: var(--type-body); }
  .support__list strong { color: var(--tx-primary); }

  /* Quem somos */
  .about { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: var(--space-12); align-items: start; }
  .about__figure { display: grid; gap: var(--space-3); }
  .about__photo { width: 100%; height: auto; display: block; border-radius: var(--radius-lg); border: 1px solid var(--bd-subtle); box-shadow: var(--shadow-ambient); object-fit: cover; }
  .about__figure figcaption { font-size: var(--type-caption); color: var(--tx-secondary); }
  .about__copy { display: grid; gap: var(--space-6); }
  .about__copy > p { color: var(--tx-secondary); font-size: var(--type-lead); }
  .fronts { display: grid; gap: var(--space-3); }
  .front { display: flex; gap: var(--space-4); padding: var(--space-5); background: var(--sf-card); border: 1px solid var(--bd-subtle); border-radius: var(--radius-md); }
  .front__num { font-family: var(--font-mono); font-weight: 700; font-size: var(--type-caption); color: var(--int-primary); padding-top: 0.35em; }
  .front__title { font-size: 1.125rem; font-weight: 700; margin-bottom: var(--space-1); }
  .front p { font-size: var(--type-small); color: var(--tx-secondary); }
  .timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); margin-top: var(--space-16); padding-top: var(--space-10); border-top: 1px solid var(--bd-subtle); }
  .timeline__item { display: grid; gap: var(--space-1); padding-left: var(--space-4); border-left: 3px solid var(--int-primary); }
  .timeline__item strong { font-size: 1.5rem; font-weight: 800; letter-spacing: var(--tracking-heading); font-variant-numeric: tabular-nums; }
  .timeline__item span { font-size: var(--type-small); color: var(--tx-secondary); }

  /* Rodapé */
  .site-footer { border-top: 1px solid var(--bd-subtle); background: var(--sf-card); padding: var(--space-12) 0 var(--space-10); }
  .site-footer__inner { display: grid; gap: var(--space-6); }
  .site-footer__brand { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); }
  .site-footer__brand img { height: 40px; width: auto; }
  .site-footer__brand p { color: var(--tx-secondary); font-size: var(--type-small); }
  .site-footer__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
  .site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--type-small); font-weight: 600; color: var(--tx-secondary); text-decoration: none; }
  .site-footer__links a:hover { color: var(--int-primary); text-decoration: underline; text-underline-offset: 0.2em; }
  .site-footer__note { font-size: var(--type-caption); color: var(--tx-secondary); max-width: 80ch; }

  /* Responsivo */
  @media (max-width: 1024px) {
    .steps, .groups__grid, .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero__inner { grid-template-columns: minmax(0, 1fr); }
    .hero__art { max-width: 340px; }
    .hero__title { max-width: 16ch; }
  }
  @media (max-width: 767px) {
    :root { --header-h: 68px; }
    .site-header__inner { gap: var(--space-3); }
    .brand__logo { height: 42px; }
    .nav-toggle { display: inline-flex; }
    .site-nav { position: absolute; inset: 100% 0 auto 0; z-index: var(--z-nav); background: var(--sf-card); border-bottom: 1px solid var(--bd-subtle); box-shadow: var(--shadow-hover); padding: var(--space-3) var(--gutter) var(--space-5); display: none; }
    .site-nav.is-open { display: block; }
    .site-nav__list { flex-direction: column; gap: var(--space-1); }
    .site-nav__link { min-height: 48px; font-size: var(--type-body); }
    .site-header__cta { display: none; }
    .hero__title { max-width: 12ch; }
    .facts { gap: var(--space-4) var(--space-6); }
    .journey__head { margin-bottom: var(--space-8); }
    .steps, .groups__grid, .timeline, .duo, .assist, .places, .about, .support { grid-template-columns: minmax(0, 1fr); }
    .assist { padding: 16px; gap: var(--space-5); margin-top: var(--space-10); border-radius: var(--radius-lg); }
    .assist__actions .btn--large { width: 100%; }
    .chat-fab span { font-size: var(--type-small); }
    .chat__input { font-size: 1rem; }
    .groups__head { grid-template-columns: minmax(0, 1fr); align-items: start; }
    .filter { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--radius-md); }
    .filter__btn { border-radius: var(--radius-sm); }
    .site-nav__cta { display: block; padding-top: var(--space-3); }
    .site-nav__cta .btn { width: 100%; }
    .btn--large { width: 100%; }
    .hero__actions { flex-direction: column; }
  }
  @media (max-width: 600px) {
    .chatw { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; }
    body.chat-open { overflow: hidden; }
  }
  @media (max-width: 420px) {
    .steps, .groups__grid { grid-template-columns: minmax(0, 1fr); }
    .hero__art { max-width: 260px; }
  }
}

/* 5. Movimento (só transform/opacity; respeita reduced-motion) */
@layer motion {
  @keyframes aurora-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(6vw, 4vh, 0) scale(1.08); }
  }
  @keyframes anel-pulse { from { opacity: 0.6; } to { opacity: 1; } }
  @keyframes gota-float { from { transform: translateY(0); } to { transform: translateY(-8px); } }
  @keyframes reveal { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
  @keyframes chatw-in { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
  @keyframes msg-in { from { opacity: 0; translate: 0 12px; scale: 0.98; } to { opacity: 1; translate: 0 0; scale: 1; } }
  @keyframes typing { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-4px); opacity: 1; } }

  @media (prefers-reduced-motion: no-preference) {
    .aurora__glow { animation: aurora-drift var(--dur-ambient) var(--ease-in-out) infinite alternate; }
    .aurora__glow--roxo { animation-duration: calc(var(--dur-ambient) * 1.3); animation-direction: alternate-reverse; }
    .aurora__glow--ciano { animation-duration: calc(var(--dur-ambient) * 1.6); }
    .constelacao__anel { animation: anel-pulse 6s var(--ease-in-out) infinite alternate; }
    .constelacao__gota { transform-box: fill-box; transform-origin: center; animation: gota-float 5s var(--ease-in-out) infinite alternate; }
    .msg { animation: msg-in var(--dur-enter) var(--ease-out) both; }
    .chatw { animation: chatw-in var(--dur-enter) var(--ease-out); }
    .chat__typing span { animation: typing 1.1s var(--ease-in-out) infinite; }
    .chat__typing span:nth-child(2) { animation-delay: 0.15s; }
    .chat__typing span:nth-child(3) { animation-delay: 0.3s; }
    .chips__more::details-content { block-size: 0; opacity: 0; overflow: clip; transition: block-size var(--dur-enter) var(--ease-out), opacity var(--dur-exit), content-visibility var(--dur-enter); transition-behavior: allow-discrete; }
    .chips__more[open]::details-content { block-size: auto; opacity: 1; }
    @starting-style { .chips__more[open]::details-content { block-size: 0; opacity: 0; } }
    @supports (animation-timeline: view()) {
      .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 200px; }
    }
    ::view-transition-group(*) { animation-duration: var(--dur-enter); animation-timing-function: var(--ease-out); }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
  }
  @media print {
    .reveal, .aurora__glow, .msg { animation: none !important; opacity: 1 !important; }
    .site-header { position: static; }
  }
  @media (forced-colors: active) {
    .filter__btn.is-active, .site-nav__link.is-current, .chip--novo, .msg--user { outline: 2px solid; outline-offset: -2px; }
  }
  @media (prefers-reduced-transparency: reduce) {
    .site-header { background: var(--sf-card); backdrop-filter: none; }
  }
}

/* 6. Utilitários */
@layer utilities {
  .sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
  .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; }
  [hidden] { display: none !important; }
}
