/* ============================================================================
   BASE.CSS — Attend · v1 "Plataforma"
   Tokens, reset, tipografia, primitivas de layout e componentes globais
   (cabeçalho, rodapé, botões, banner LGPD).

   O CSS específico de cada seção da home vive em index.css.

   Ordem do arquivo:
     1. Tokens
     2. Reset
     3. Tipografia
     4. Layout (wrap, section, eyebrow, section-head)
     5. Botões e links
     6. Cabeçalho e navegação
     7. Rodapé
     8. Banner de consentimento (LGPD)
     9. Utilitários e revelação ao rolar
   ========================================================================== */

/* ------------------------------------------------------------------ *
   1. TOKENS
 * ------------------------------------------------------------------ */
:root {
    /* --- Tinta e papel -------------------------------------------------
       Paleta clara e corporativa. O texto corrido usa --ink-700 em vez de
       preto puro: em telas grandes, preto sobre branco cansa a leitura. */
    --paper: #ffffff;
    --paper-2: #f7f8fa;
    --paper-3: #eef1f5;
    --ink-900: #0b0e13;
    --ink-700: #262d37;
    --ink-500: #4d5866;
    --ink-400: #6d7887;
    /* 4.6:1 sobre --paper — mínimo AA para texto pequeno */

    --line: #e4e8ee;
    --line-strong: #cdd4dd;

    /* --- Acentos da marca ----------------------------------------------
       #d9f99d (lima) e #a78bfa (violeta) vêm do site anterior. Nenhum dos
       dois tem contraste para TEXTO sobre branco (lima ~1.2:1, violeta
       ~2.3:1). Por isso existem duas famílias de token:
         --lime / --violet        → preenchimento, borda, marcador
         --lime-ink / --violet-ink → quando a cor precisa virar texto        */
    --lime: #d9f99d;
    --lime-soft: #f2fddb;
    --lime-ink: #3f5407;
    /* 8.4:1 sobre --lime */
    --violet: #a78bfa;
    --violet-soft: #f3eeff;
    --violet-ink: #5b21b6;
    /* 8.1:1 sobre --paper */

    /* --- Tipografia --------------------------------------------------- */
    --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
    --font-text: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Escala fluida: o mesmo texto de 360px a 1920px sem media query. */
    --t-display: clamp(2.5rem, 1.4rem + 4.6vw, 5.25rem);
    --t-h2: clamp(1.95rem, 1.2rem + 2.9vw, 3.5rem);
    --t-h3: clamp(1.15rem, 1.02rem + 0.5vw, 1.4rem);
    --t-lead: clamp(1.06rem, 0.98rem + 0.42vw, 1.3rem);
    --t-body: 1rem;
    --t-small: 0.875rem;
    --t-micro: 0.75rem;

    /* --- Espaçamento --------------------------------------------------- */
    --wrap: 1200px;
    --gutter: clamp(1.25rem, 0.6rem + 2.6vw, 3rem);
    --section-y: clamp(4rem, 2.2rem + 7vw, 8.5rem);

    /* --- Formas e sombras ---------------------------------------------- */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --shadow-1: 0 1px 2px rgba(11, 14, 19, .05), 0 1px 1px rgba(11, 14, 19, .04);
    --shadow-2: 0 12px 32px -12px rgba(11, 14, 19, .14), 0 2px 6px rgba(11, 14, 19, .05);
    --shadow-3: 0 32px 64px -28px rgba(11, 14, 19, .28), 0 4px 12px rgba(11, 14, 19, .06);

    --ring: 0 0 0 3px rgba(91, 33, 182, .28);
    /* foco visível, violeta */
    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ------------------------------------------------------------------ *
   2. RESET
 * ------------------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink-700);
    font-family: var(--font-text);
    font-size: var(--t-body);
    font-weight: 400;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Trava a rolagem horizontal em qualquer largura.
       `clip` e não `hidden`: `hidden` transformaria o body em contêiner de
       rolagem e quebraria o position:sticky do cabeçalho. */
    overflow-x: clip;
}

img,
svg {
    max-width: 100%;
    display: block;
}

table {
    border-collapse: collapse;
}

button {
    font: inherit;
    color: inherit;
}

/* Âncoras não podem parar embaixo do cabeçalho fixo. */
[id] {
    scroll-margin-top: 84px;
}

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ------------------------------------------------------------------ *
   3. TIPOGRAFIA
 * ------------------------------------------------------------------ */
h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--ink-900);
    font-weight: 400;
    letter-spacing: -.015em;
}

h1,
h2 {
    font-family: var(--font-display);
    line-height: 1.04;
    letter-spacing: -.02em;
}

h1 {
    font-size: var(--t-display);
}

h2 {
    font-size: var(--t-h2);
}

h3 {
    font-family: var(--font-text);
    font-size: var(--t-h3);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -.01em;
}

p {
    margin: 0 0 1em;
}

p:last-child {
    margin-bottom: 0;
}

/* Itálico do Instrument Serif — o gesto editorial da marca. Usado para
   destacar UMA expressão por título, nunca a frase inteira. */
.em {
    font-style: italic;
    color: var(--violet-ink);
}

.lead {
    font-size: var(--t-lead);
    line-height: 1.55;
    color: var(--ink-500);
    max-width: 62ch;
}

.mono {
    font-family: var(--font-mono);
    font-size: .8em;
    letter-spacing: .02em;
    font-variant-ligatures: none;
}

strong,
b {
    font-weight: 600;
    color: var(--ink-900);
}

/* ------------------------------------------------------------------ *
   4. LAYOUT
 * ------------------------------------------------------------------ */
.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section-y);
    border-top: 1px solid var(--line);
}

.section--tint {
    background: var(--paper-2);
}

.section--ink {
    background: var(--ink-900);
    color: #c9d1dc;
    border-top-color: var(--ink-900);
}

.section--ink h2,
.section--ink h3 {
    color: #fff;
}

.section--ink .lead {
    color: #9aa5b4;
}

/* Etiqueta numerada da seção — herdada do site antigo ("/ 01 — Como
   funciona"), que já usava esse recurso para dar ritmo à página. */
.eyebrow {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0 0 1.35rem;
    font-family: var(--font-mono);
    font-size: var(--t-micro);
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-400);
}

.eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    background: var(--violet);
    flex: none;
}

.section--ink .eyebrow {
    color: #8b96a6;
}

.section-head {
    max-width: 46rem;
    margin-bottom: clamp(2.5rem, 1.4rem + 3vw, 4rem);
}

.section-head .lead {
    margin-top: 1.15rem;
}

/* ------------------------------------------------------------------ *
   5. BOTÕES E LINKS
 * ------------------------------------------------------------------ */
a {
    color: var(--violet-ink);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--ink-900);
}

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 6px;
}

.section--ink :focus-visible {
    box-shadow: 0 0 0 3px rgba(217, 249, 157, .55);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .82rem 1.35rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .18s var(--ease), background-color .18s var(--ease),
        border-color .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease);
}

.btn:active {
    transform: translateY(1px);
}

.btn svg {
    flex: none;
}

.btn--primary {
    background: var(--ink-900);
    color: #fff;
    box-shadow: var(--shadow-2);
}

.btn--primary:hover {
    background: #1c2531;
    color: #fff;
    box-shadow: var(--shadow-3);
}

.btn--ghost {
    background: var(--paper);
    color: var(--ink-900);
    border-color: var(--line-strong);
}

.btn--ghost:hover {
    background: var(--paper-2);
    border-color: var(--ink-400);
    color: var(--ink-900);
}

.btn--lime {
    background: var(--lime);
    color: var(--lime-ink);
    border-color: #c6ec7f;
}

.btn--lime:hover {
    background: #cdf585;
    color: var(--lime-ink);
}

.btn--sm {
    padding: .55rem 1rem;
    font-size: .875rem;
}

/* Link com seta que anda no hover. */
.arrow-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
}

.arrow-link::after {
    content: "→";
    transition: transform .18s var(--ease);
}

.arrow-link:hover::after {
    transform: translateX(4px);
}

/* ------------------------------------------------------------------ *
   6. CABEÇALHO
 * ------------------------------------------------------------------ */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--ink-900);
    color: #fff;
    padding: .75rem 1.1rem;
    border-radius: 0 0 var(--r-sm) 0;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

/* .is-stuck é aplicado por JS depois do primeiro scroll — a borda só
   aparece quando o conteúdo passa por baixo do cabeçalho. */
.header.is-stuck {
    border-bottom-color: var(--line);
    box-shadow: 0 1px 12px rgba(11, 14, 19, .05);
}

.header__bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 66px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--ink-900);
    text-decoration: none;
    letter-spacing: -.01em;
    flex: none;
}

.brand__mark {
    width: 26px;
    height: 26px;
    flex: none;
}

/* Logotipo da Attend. Altura fixa + `width:auto` mantem a proporcao do arquivo
   (387x89); `flex:none` impede que o flex do header espreme a largura e deixe
   a marca achatada. */
.brand__logo {
    height: 30px;
    width: auto;
    flex: none;
}

.footer__brand .brand__logo {
    height: 34px;
}

.nav {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-left: auto;
}

.nav a {
    padding: .5rem .7rem;
    border-radius: var(--r-sm);
    color: var(--ink-500);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s var(--ease), background-color .15s var(--ease);
}

.nav a:hover {
    color: var(--ink-900);
    background: var(--paper-3);
}

.header__cta {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: none;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    padding: .5rem .8rem;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 940px) {
    .nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: .5rem var(--gutter) 1.1rem;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-2);
    }

    .nav.is-open {
        display: flex;
    }

    .nav a {
        padding: .8rem .25rem;
        font-size: 1rem;
        border-bottom: 1px solid var(--line);
    }

    .nav-toggle {
        display: block;
    }

    .header__cta .btn--ghost {
        display: none;
    }
}

@media (max-width: 460px) {
    .header__cta .btn span {
        display: none;
    }

    /* Marca menor no celular: com o botao Menu e o CTA na mesma linha, 30px
       de logo nao cabem em 360px de tela. */
    .brand__logo {
        height: 24px;
    }

    /* no celular sobra só o ícone de telefone */
}

/* ------------------------------------------------------------------ *
   7. RODAPÉ
 * ------------------------------------------------------------------ */
.footer {
    background: var(--ink-900);
    color: #8b96a6;
    padding-block: clamp(3rem, 2rem + 3vw, 4.5rem) 2rem;
    font-size: var(--t-small);
}

.footer a {
    color: #c9d1dc;
    text-decoration: none;
}

.footer a:hover {
    color: var(--lime);
}

.footer__top {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) repeat(auto-fit, minmax(150px, 1fr));
    gap: 2.5rem 2rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid #1e242e;
}

.footer__brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: #fff;
    margin-bottom: .9rem;
}

.footer h4 {
    color: #fff;
    font-family: var(--font-mono);
    font-size: var(--t-micro);
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .6rem;
}

.footer__bottom {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    justify-content: space-between;
    padding-top: 1.75rem;
    font-size: var(--t-micro);
    color: #69737f;
}

/* ------------------------------------------------------------------ *
   8. BANNER DE CONSENTIMENTO (LGPD)
   Fica fora da tela por padrão; consent.js adiciona .is-visible.
 * ------------------------------------------------------------------ */
.consent {
    position: fixed;
    z-index: 150;
    left: var(--gutter);
    right: var(--gutter);
    bottom: var(--gutter);
    max-width: 44rem;
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    padding: 1.15rem 1.35rem;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    font-size: var(--t-small);
    color: var(--ink-500);
    /* invisível E fora do fluxo de foco enquanto não decidido */
    visibility: hidden;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
}

.consent.is-visible {
    visibility: visible;
    opacity: 1;
    transform: none;
}

.consent p {
    flex: 1 1 22rem;
    margin: 0;
}

.consent__actions {
    display: flex;
    gap: .6rem;
    margin-left: auto;
}

/* ------------------------------------------------------------------ *
   9. UTILITÁRIOS
 * ------------------------------------------------------------------ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Revelação ao rolar. O estado inicial só é aplicado quando o JS marca
   <html class="js"> — sem JS a página aparece inteira, normal. */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
}

.js .reveal.is-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .js .reveal {
        opacity: 1;
        transform: none;
    }
}
