/* Tokens: Figma "Tatui Tech Branding" · coleções Origem (Primitives, Color/Dark, Dimension, Motion) */
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Primitives */
  --ink-300: #bbbec2;
  --ink-800: #262f39;
  --ink-950: #0b0f14;
  --stone-50: #f5f2ed;
  --stone-200: #e2dfdb;
  --copper-300: #f0bd98;
  --terracotta-400: #f88a5f;
  --terracotta-500: #d5622a;

  /* Color · Dark */
  --bg-canvas: var(--ink-950);
  --text-primary: var(--stone-50);
  --text-secondary: var(--ink-300);
  --text-brand: var(--copper-300);
  --border-default: var(--ink-800);
  --border-focus: var(--terracotta-400);
  --action-primary: var(--stone-50);
  --action-primary-hover: var(--stone-200);
  --action-on-primary: var(--ink-950);
  --logo-dot: var(--terracotta-500);

  /* Camada sobre o vídeo: Dark Ink com opacity/64 e opacity/80 */
  --scrim: rgb(11 15 20 / 0.64);
  --scrim-strong: rgb(11 15 20 / 0.8);
  --hairline-on-media: rgb(245 242 237 / 0.24);

  /* Dimension */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --radius-md: 12px;
  /* Mobile: faixa entre a assinatura e o "Em breve"; space/8 (32 px) + o respiro interno do
     sobretítulo resulta em ~35 px ópticos entre a tinta do logo e a do indicador */
  --logo-gap: var(--space-8);

  /* Motion */
  --duration-base: 240ms;
  --duration-moderate: 400ms;
  --duration-slow: 600ms;
  --stagger-segment: 80ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-enter: cubic-bezier(0.05, 0.7, 0.1, 1);

  --font-brand: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad: var(--space-6);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100svh;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-brand);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fundo: poster estático, vídeo por cima e camada Dark Ink para leitura */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-canvas);
}

.backdrop img,
.backdrop video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.backdrop video[hidden] { display: none; }

/* Poster aparece de imediato; o vídeo entra por cima quando começa a tocar (o 1º quadro é igual ao poster) */
.backdrop video { transition: opacity var(--duration-moderate) var(--ease-standard); }
.backdrop video.is-pending { opacity: 0; }

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, var(--scrim-strong), transparent 24%, transparent 64%, var(--scrim-strong)),
    radial-gradient(ellipse 72% 56% at 50% 50%, var(--scrim-strong), transparent),
    var(--scrim);
}

.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-12);
  /* Safe areas (viewport-fit=cover): o maior entre o respiro do grid e o recorte do aparelho */
  padding:
    max(var(--pad), env(safe-area-inset-top))
    max(var(--pad), env(safe-area-inset-right))
    max(var(--pad), env(safe-area-inset-bottom))
    max(var(--pad), env(safe-area-inset-left));
  text-align: center;
}

/* Mobile: assinatura, indicador e título formam um bloco único, centrado na área acima do rodapé.
   Linhas: espaço · assinatura · intervalo · hero · espaço (mín. 24 px) · rodapé */
@media (max-width: 639.98px) {
  .page {
    display: grid;
    grid-template-rows: 1fr auto var(--logo-gap) auto minmax(var(--space-6), 1fr) auto;
    justify-items: center;
    gap: 0;
  }
  .brand { grid-row: 2; }
  .hero { grid-row: 4; }
  .foot { grid-row: 6; }
}

.brand { display: inline-flex; border-radius: var(--radius-md); }
.brand img { display: block; width: 184px; height: auto; }

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

/* Origem/Overline */
.overline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--text-brand);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Graphic/Ponto de origem */
.overline::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--logo-dot);
}

/* Escala Origem/Headline/L → Display/XL, em SemiBold (600) para um título mais leve */
.headline {
  margin: 0;
  max-width: 12ch;
  font-weight: 600;
  font-size: 44px;
  line-height: 52px;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* Uma máscara por linha; o padding dá folga a acentos e descendentes e a margem negativa o anula no layout
   (flex column para as margens não colapsarem entre as linhas) */
.headline { display: flex; flex-direction: column; }

.headline .line {
  display: block;
  overflow: hidden;
  padding-block: 0.2em 0.25em;
  margin-block: -0.2em -0.25em;
}

.headline .line > span { display: block; }

/* Abaixo de 346 px "que se adapta." (298 px a 44 px) não cabe: mantém a quebra original "que / se adapta."
   dentro da mesma máscara */
@media (max-width: 346px) {
  .headline .seg { display: block; }
}

/* Origem/Body/L */
.lead {
  margin: 0;
  max-width: 36ch;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 30px;
}

/* Origem/Body/S */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3) var(--space-6);
  width: 100%;
  max-width: 1280px;
  padding-top: var(--space-6);
  border-top: 1px solid var(--hairline-on-media);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 22px;
}

.foot p { margin: 0; }

/* Button · Primary · Size M */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 44px;
  margin-top: var(--space-4);
  padding: 0 20px;
  border-radius: var(--radius-md);
  background: var(--action-primary);
  color: var(--action-on-primary);
  font-weight: 600;
  font-size: 14px;
  line-height: 18px;
  text-decoration: none;
  transition: background-color var(--duration-base) var(--ease-standard);
}

.button:hover { background: var(--action-primary-hover); }
.button img { width: 20px; height: 20px; }

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 4px;
}

@media (min-width: 640px) {
  :root { --pad: var(--space-12); }
  .brand img { width: 248px; }
  .headline { font-size: 56px; line-height: 60px; letter-spacing: -0.025em; }
}

@media (min-width: 1200px) {
  :root { --pad: var(--space-16); }
  .headline { font-size: 72px; line-height: 76px; letter-spacing: -0.03em; }
}

@media (min-width: 1600px) {
  .headline { font-size: 96px; line-height: 96px; letter-spacing: -0.035em; }
}

/* Coreografia de entrada (ritmo de maré: entradas desaceleram ao chegar), só transform e opacity */
@media (prefers-reduced-motion: no-preference) {
  /* 0–400 ms: assinatura */
  .brand { animation: rise-12 var(--duration-moderate) var(--ease-enter) both; }
  /* 300–700 ms: indicador e rodapé */
  .overline,
  .foot { animation: fade var(--duration-moderate) var(--ease-standard) 300ms both; }
  /* 100–820 ms: título, cada linha sobe 24 px dentro da sua máscara, 120 ms de defasagem.
     Sem opacidade, o título é pintado (e mensurável como LCP) desde o primeiro quadro; por isso a máscara
     já começa em movimento, para o corte nunca ficar parado na tela */
  .headline .line > span { animation: reveal var(--duration-slow) var(--ease-enter) 100ms both; }
  .headline .line + .line > span { animation-delay: 220ms; }
  .lead { animation: fade var(--duration-moderate) var(--ease-standard) 700ms both; }
  /* Ponto do "Em breve": pulsa depois que o indicador entrou */
  .overline::before { animation: pulse 2s ease-in-out 700ms infinite; }
}

/* Redução de movimento: conteúdo final de imediato, sem pulso e com o poster no lugar do vídeo */
@media (prefers-reduced-motion: reduce) {
  .backdrop video { display: none; }
}

@keyframes rise-12 {
  from { opacity: 0; transform: translateY(12px); }
}

@keyframes reveal {
  from { transform: translateY(24px); }
}

@keyframes fade {
  from { opacity: 0; }
}

@keyframes pulse {
  50% { opacity: 0.35; }
}
