/* O estilo de todas as páginas de eleven-app.pt (servido em /marca/eleven.css).
   Claro, de propósito: sem `color-scheme: light` alguns browsers Android
   escurecem a página sozinhos e as cores da marca saem trocadas. A excepção
   é a página de entrada (`.entrada`, no fim), escura e com o seu próprio
   `color-scheme: dark`. */
@font-face { font-family: Outfit; font-weight: 400; font-display: swap; src: url("/marca/outfit-400.woff2") format("woff2"); }
@font-face { font-family: Outfit; font-weight: 700; font-display: swap; src: url("/marca/outfit-700.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --fundo: #F4F6F9;
  --cartao: #FFFFFF;
  --texto: #0B1220;
  /* os papéis do tema claro da app (src/constants/theme.ts): TEXT_SECONDARY e LINE */
  --texto-2: #5C6B85;
  --texto-3: #5C6B85;
  --linha: #D9DEE6;
  --azul: #00428C;
  --laranja: #ED610F;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 16px/1.65 Outfit, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: var(--azul); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }

.topo { border-bottom: 1px solid var(--linha); background: var(--fundo); }
.topo a { display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 0 auto; padding: 14px 24px; color: var(--texto); font-size: 1.2rem; letter-spacing: -.01em; text-decoration: none; }
.topo img { width: 26px; height: 32px; }

main { max-width: 720px; margin: 0 auto; padding: 36px 24px 48px; }
h1 { font-size: 1.85rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 8px; }
h2 { font-size: 1.12rem; line-height: 1.3; color: var(--azul); margin: 32px 0 8px; }
h3 { font-size: 1rem; margin: 20px 0 6px; }
p, li { color: var(--texto-2); }
strong { color: var(--texto); }
ul { padding-left: 1.2em; }
li { margin: 4px 0; }
.meta { color: var(--texto-3); font-size: .9rem; margin: 0 0 28px; }

.card { background: var(--cartao); border: 1px solid var(--linha); border-radius: 16px; padding: 18px 22px; margin-top: 24px; }
.card h2 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.destaque { background: var(--cartao); border: 1px solid var(--linha); border-left: 3px solid var(--laranja); border-radius: 16px; padding: 4px 20px; margin: 24px 0; }
.en { border-top: 1px solid var(--linha); margin-top: 56px; padding-top: 24px; }

.botao { display: block; text-align: center; background: var(--azul); color: #fff; padding: 15px 20px; border-radius: 16px; margin: 28px 0 0; }
.botao:hover { text-decoration: none; }

.rodape { border-top: 1px solid var(--linha); }
.rodape div { max-width: 720px; margin: 0 auto; padding: 20px 24px 40px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; color: var(--texto-3); }

/* As páginas de um link partilhado e o fim da verificação */
.curta { max-width: 480px; padding-top: 48px; }
.curta h1 { font-size: 1.7rem; }
.centro { text-align: center; padding-top: 72px; }
.icone-pequeno { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 16px; }

/* A página de entrada (eleven-app.pt/): escura, só esta. Sem JavaScript: o que
   mexe ao rolar é CSS (`animation-timeline`); onde não houver, a página fica
   parada e inteira. */
.entrada {
  color-scheme: dark;
  --fundo: #08090b; --texto: #f3f1ec;
  --texto-2: rgb(243 241 236 / .62); --linha: rgb(243 241 236 / .16);
  --margem: clamp(20px, 3.9vw, 56px); --intervalo: 16px;
  --seccao: clamp(72px, 9vw, 140px);
  --t-enorme: clamp(44px, 7.6vw, 120px);
  --t-titulo: clamp(28px, 3.6vw, 52px);
  --t-lead: clamp(18px, 1.9vw, 26px);
  --t-meta: clamp(12px, .95vw, 14px);
  --suave: cubic-bezier(.16, .84, .24, 1);
  --sombra: 0 0 0 1px rgb(243 241 236 / .12), 0 30px 80px rgb(0 0 0 / .55);
  background: var(--fundo); color: var(--texto); line-height: 1.45; overflow-x: clip;
}
.entrada * { margin: 0; padding: 0; }
.entrada main { max-width: none; }
.entrada :is(h1, h2) { color: inherit; }
.entrada a { color: inherit; font-weight: inherit; }
.entrada a:hover { text-decoration: none; }
/* sem especificidade: senão ganhava ao tamanho das imagens com classe */
:where(.entrada) img { display: block; max-width: 100%; height: auto; }
.entrada em { font-style: normal; color: var(--laranja); }

.caixa { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border: 1px solid currentColor; border-radius: 999px; font-weight: 700; transition: background-color .25s var(--suave), color .25s var(--suave), transform .16s var(--suave); }
.caixa:active { transform: scale(.97); }
.caixa.cheia { background: var(--laranja); border-color: var(--laranja); color: #fff; }
.lojas { display: flex; flex-wrap: wrap; gap: 12px; }
/* num ecrã de toque o :hover fica preso depois do toque */
@media (hover: hover) { .caixa:hover, .caixa.cheia:hover { background: var(--texto); border-color: var(--texto); color: var(--fundo); } }

.barra { position: fixed; inset: 0 0 auto; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 72px; padding: 0 var(--margem); background: color-mix(in srgb, var(--fundo) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.barra .marca { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; letter-spacing: -.02em; }
.barra .marca img { width: 26px; height: 32px; }
.barra nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); font-size: 15px; }
.barra nav a:not(.caixa) { color: var(--texto-2); transition: color .2s; }
.barra nav a:not(.caixa):hover { color: var(--texto); }
.barra .caixa { min-height: 40px; padding: 0 18px; font-size: 14px; }
@media (max-width: 720px) { .barra nav a:not(.caixa) { display: none; } }

/* ── o herói ── */
.heroi { position: relative; isolation: isolate; min-height: 100svh; display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--intervalo); align-items: end; padding: 120px var(--margem) clamp(40px, 6vw, 88px); overflow: hidden; }
.heroi::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(50% 60% at 80% 55%, rgb(237 97 15 / .5), transparent 70%),
  radial-gradient(40% 40% at 95% 100%, rgb(237 97 15 / .3), transparent 70%); }
.heroi-texto { grid-column: 1 / span 7; }
.heroi h1 { font-size: var(--t-enorme); line-height: .95; letter-spacing: -.045em; }
/* cada linha sobe de trás de uma máscara */
.heroi h1 > span { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.heroi h1 > span > span { display: block; }
.heroi p { font-size: var(--t-lead); color: var(--texto-2); max-width: 32ch; line-height: 1.3; margin: clamp(24px, 2.6vw, 36px) 0 28px; }

/* A carrossel do separador Clube, como na app (src/components/clube/CartaoAnimado.tsx):
   o cartão ao centro sobe 10px, os vizinhos encolhem para .92 e rodam 8° em
   perspectiva de 900px, 12px entre cartões, sem pontos. Aqui avança sozinha:
   4 cartões × 3,5 s; cada um passa pelos lugares 0 → −1 → (fora) → +1 → 0 e
   dá a volta por fora da vista. */
.carrossel { --alto: min(calc(100svh - 240px), 680px); --largo: calc(var(--alto) * 600 / 1345); --passo: calc(100% + 12px);
  grid-column: 8 / span 5; grid-row: 1; justify-self: center; align-self: center; position: relative; width: calc(var(--largo) * 1.62); max-width: 100%; height: calc(var(--alto) + 80px);
  perspective: 900px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.carrossel img { position: absolute; top: 50%; left: 50%; width: var(--largo); height: var(--alto); margin: calc(var(--alto) / -2) 0 0 calc(var(--largo) / -2); object-fit: cover; object-position: top; border-radius: calc(var(--largo) * .043); box-shadow: var(--sombra); }
.carrossel img:nth-child(1) { transform: translateY(-10px); }
.carrossel img:nth-child(2) { transform: translateX(var(--passo)) scale(.92) rotateY(8deg); }
.carrossel img:nth-child(3) { transform: translateX(calc(var(--passo) * 2)) scale(.92); }
.carrossel img:nth-child(4) { transform: translateX(calc(var(--passo) * -1)) scale(.92) rotateY(-8deg); }
@media (max-width: 720px) {
  .heroi { padding-top: 96px; align-items: start; }
  .heroi-texto { grid-column: 1 / -1; }
  /* no telemóvel o cartão vai INTEIRO (cortado a meio parecia avariado): a altura manda, a largura segue a proporção */
  .carrossel { --alto: min(68svh, 560px); grid-column: 1 / -1; grid-row: auto; width: 100%; height: calc(var(--alto) + 60px); margin-top: 8px; }
}

/* ── a frase ── */
.frase { padding: var(--seccao) var(--margem); border-top: 1px solid var(--linha); }
.frase p { font-size: var(--t-titulo); line-height: 1.12; letter-spacing: -.025em; max-width: 24ch; margin-left: calc(25% - var(--margem) / 2); color: var(--texto); }
.frase span { color: var(--texto-2); }
@media (max-width: 720px) { .frase p { margin-left: 0; } }

/* ── a cena: sem efeitos (telemóvel, browsers sem animation-timeline), cada texto seguido do seu ecrã ── */
.cena { display: grid; grid-template-columns: minmax(0, 560px); padding: 0 var(--margem) var(--seccao); border-top: 1px solid var(--linha); }
.cena-textos, .cena-tel, .cena-ecras, .cena-moldura { display: contents; }
.cena-passo { padding: var(--seccao) 0 28px; }
.cena-passo h2, .fecho h2 { font-size: var(--t-titulo); line-height: 1.05; letter-spacing: -.03em; }
.cena-passo h2 { margin-bottom: 18px; }
.cena-passo p { color: var(--texto-2); max-width: 36ch; font-size: var(--t-lead); line-height: 1.35; }
.cena-moldura img { width: 100%; max-width: 340px; border-radius: 32px; box-shadow: var(--sombra); }
.cena-passo:nth-child(1) { order: 1; } .cena-moldura img:nth-child(1) { order: 2; }
.cena-passo:nth-child(2) { order: 3; } .cena-moldura img:nth-child(2) { order: 4; }
.cena-passo:nth-child(3) { order: 5; } .cena-moldura img:nth-child(3) { order: 6; }
.cena-passo:nth-child(4) { order: 7; } .cena-moldura img:nth-child(4) { order: 8; }

/* ── o fim ── */
.fecho { padding: var(--seccao) var(--margem) 0; border-top: 1px solid var(--linha); }
.fecho h2 { max-width: 16ch; margin-bottom: 28px; }
.fecho .independente { margin-top: 48px; color: var(--texto-2); font-size: var(--t-meta); max-width: 60ch; }
.entrada .rodape { border-top-color: var(--linha); margin-top: 48px; }
.entrada .rodape div { max-width: none; padding: 28px var(--margem); justify-content: space-between; color: var(--texto-2); }
.entrada .rodape a { color: var(--texto-2); }
.entrada .rodape a:hover { color: var(--texto); }

/* ── o movimento ── */
@media (prefers-reduced-motion: no-preference) {
  .heroi h1 > span > span { animation: subir 1.1s var(--suave) both .15s; }
  .heroi h1 > span:nth-child(2) > span { animation-delay: .27s; }
  .heroi p { animation: surgir .9s var(--suave) both .55s; }
  .heroi .lojas { animation: surgir .9s var(--suave) both .68s; }
  .carrossel { animation: surgir-carrossel 1.3s var(--suave) both .35s; }
  .carrossel img { animation: carrossel 14s infinite both; }
  .carrossel img:nth-child(2) { animation-delay: -10.5s; }
  .carrossel img:nth-child(3) { animation-delay: -7s; }
  .carrossel img:nth-child(4) { animation-delay: -3.5s; }
  .carrossel:hover img { animation-play-state: paused; }
}
@keyframes subir { from { transform: translateY(105%); } }
@keyframes surgir { from { opacity: 0; transform: translateY(18px); } }
@keyframes surgir-carrossel { from { opacity: 0; transform: translateY(60px); } }
@keyframes carrossel {
  0%, 21% { transform: translateY(-10px); animation-timing-function: var(--suave); }
  25%, 46% { transform: translateX(calc(var(--passo) * -1)) scale(.92) rotateY(-8deg); animation-timing-function: var(--suave); }
  50%, 60% { transform: translateX(calc(var(--passo) * -2)) scale(.92) rotateY(-8deg); animation-timing-function: step-end; }
  60.01%, 71% { transform: translateX(calc(var(--passo) * 2)) scale(.92) rotateY(8deg); animation-timing-function: var(--suave); }
  75%, 96% { transform: translateX(var(--passo)) scale(.92) rotateY(8deg); animation-timing-function: var(--suave); }
  100% { transform: translateY(-10px); }
}

@supports (animation-timeline: view()) and (timeline-scope: --a) {
  @media (prefers-reduced-motion: no-preference) {
    .entrada [data-ver] { animation: aparecer linear both; animation-timeline: view(); animation-range: entry 0% cover 25%; }
    /* não `entry 0% entry 100%`: num bloco mais alto que o ecrã a fase `entry` dura até ele caber todo, e fica meio transparente à vista */
    @keyframes aparecer { from { opacity: 0; translate: 0 32px; } }

    /* a frase acende-se de cima para baixo */
    @property --luz { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
    .frase p { color: transparent; background: linear-gradient(175deg, var(--texto) calc(var(--luz) - 12%), rgb(243 241 236 / .16) calc(var(--luz) + 4%)); -webkit-background-clip: text; background-clip: text; animation: acender linear both; animation-timeline: view(); animation-range: cover 15% cover 55%; }
    .frase span { color: inherit; }
    @keyframes acender { from { --luz: 0%; } to { --luz: 112%; } }

    /* as linhas entre secções desenham-se */
    .frase, .cena, .fecho { border-top-color: transparent; position: relative; }
    :is(.frase, .cena, .fecho)::before { content: ""; position: absolute; top: -1px; left: var(--margem); right: var(--margem); height: 1px; background: var(--linha); transform-origin: 0 50%; animation: desenhar linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
    @keyframes desenhar { from { transform: scaleX(0); } }

    /* a barra só ganha fundo depois de sair do topo */
    .barra { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; animation: barra-solida linear both; animation-timeline: scroll(); animation-range: 0 120px; }
    @keyframes barra-solida { to { background: color-mix(in srgb, var(--fundo) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); } }

    /* ecrã largo: o telemóvel fica preso e o ecrã de dentro troca com o texto ao centro */
    @media (min-width: 721px) {
      .cena { grid-template-columns: repeat(12, 1fr); gap: var(--intervalo); padding-bottom: 0; timeline-scope: --p1, --p2, --p3, --p4; }
      .cena-textos { display: block; grid-column: 1 / span 5; }
      .cena-passo { min-height: 100svh; padding: 0; display: flex; flex-direction: column; justify-content: center; animation: focar linear both; animation-timeline: view(); }
      .cena-tel { display: block; grid-column: 7 / span 6; }
      .cena-ecras { display: grid; place-items: center; position: sticky; top: 0; height: 100svh; padding-top: 72px; }
      .cena-moldura { display: block; position: relative; height: min(calc(100svh - 160px), 720px); aspect-ratio: 600 / 1304; overflow: hidden; border-radius: 32px; background: #000; box-shadow: var(--sombra); }
      .cena-moldura img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; border-radius: 0; box-shadow: none; animation-timing-function: linear; animation-fill-mode: both; }
      .cena-passo:nth-child(1) { view-timeline-name: --p1; }
      .cena-passo:nth-child(2) { view-timeline-name: --p2; }
      .cena-passo:nth-child(3) { view-timeline-name: --p3; }
      .cena-passo:nth-child(4) { view-timeline-name: --p4; }
      /* o novo entra por baixo (`translate`) e o velho recua e escurece (`transform`, `filter`):
         propriedades diferentes, para as duas animações do mesmo ecrã não se pisarem */
      .cena-moldura img:nth-child(1) { animation-name: recua; animation-timeline: --p1; animation-range: cover 80% cover 100%; }
      .cena-moldura img:nth-child(2) { animation-name: entra, recua; animation-timeline: --p2, --p2; animation-range: cover 30% cover 50%, cover 80% cover 100%; }
      .cena-moldura img:nth-child(3) { animation-name: entra, recua; animation-timeline: --p3, --p3; animation-range: cover 30% cover 50%, cover 80% cover 100%; }
      .cena-moldura img:nth-child(4) { animation-name: entra; animation-timeline: --p4; animation-range: cover 30% cover 50%; }
    }
    @keyframes entra { from { translate: 0 100%; } }
    @keyframes recua { to { transform: translateY(-24%); filter: brightness(.35); } }
    @keyframes focar { 0% { opacity: .15; } 35%, 65% { opacity: 1; } 100% { opacity: .15; } }
  }
}
