/* =============================================================================
   The Crossing Club — style.css
   Ordem: tokens -> reset/base -> tipografia -> Home -> Member -> a11y -> responsivo
   Toda a interface em inglês. Acento único: terracota. Sem cor fora da paleta.
   ============================================================================= */

/* ---------- Tokens (manual de marca) ------------------------------------- */
:root {
  /* escala bruta */
  --tinta-900: #211c16;
  --tinta-700: #3a332a;
  --tinta-500: #5a5040;
  --terracota-500: #7b4a34; /* único acento */
  --pedra-300: #b7ab95;
  --areia-100: #efe9dd;
  --areia-50: #f6f3ec;

  /* semânticos */
  --fundo-profundo: var(--tinta-900);
  --fundo-papel: var(--areia-100);
  --fundo-claro: var(--areia-50);
  --texto-forte: var(--tinta-900);
  --texto-suave: var(--tinta-500);
  --texto-reverso: var(--areia-50);
  --marca-acento: var(--terracota-500);
  --marca-linha: var(--tinta-500);
  --borda-sutil: var(--pedra-300);

  /* componentes do reverso para uso com opacidade */
  --reverso-rgb: 246, 243, 236;

  /* fontes */
  --font-brand: 'EB Garamond', Georgia, serif;
  --font-ui: 'Inter', system-ui, sans-serif;
}

/* ---------- Reset / base ------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--fundo-profundo);
  color: var(--texto-reverso);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* =============================================================================
   HOME (index.html) — body.home
   ============================================================================= */
body.home {
  overflow: hidden; /* tela cheia, sem scroll */
}

.stage {
  position: fixed;
  inset: 0;
  background: var(--fundo-profundo);
}

/* ---- Reel: vídeos empilhados, crossfade por opacidade ------------------- */
.reel {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--fundo-profundo);
}

.reel__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  background: var(--fundo-profundo); /* fallback anti-flash no lugar do poster */
  transition: opacity 1200ms ease;
}

.reel__video.is-active {
  opacity: 1;
}

/* ---- Vinheta: escurece só as bordas, centro limpo, não tinge o vídeo ---- */
.vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 0 250px 60px rgba(0, 0, 0, 0.85);
}

/* ---- Member Area: botão topo-direito ------------------------------------ */
.member-link {
  position: absolute;
  top: 34px;
  right: 40px;
  z-index: 3;
  padding: 11px 20px;
  border: 1px solid rgba(var(--reverso-rgb), 0.3);
  border-radius: 3px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--texto-reverso);
  transition:
    border-color 240ms ease,
    background-color 240ms ease;
}

.member-link:hover {
  border-color: rgba(var(--reverso-rgb), 0.55);
  background-color: rgba(var(--reverso-rgb), 0.04);
}

/* No desktop mostra o texto; o ícone sanduíche fica só no mobile. */
.member-link__icon {
  display: none;
}

/* ---- Marca central ------------------------------------------------------ */
.brand {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  pointer-events: none;
}

/* scrim radial levíssimo, só atrás da marca — seguro para frames claros */
.brand::before {
  content: '';
  position: absolute;
  width: min(680px, 86vw);
  height: min(420px, 52vh);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0));
  filter: blur(8px);
  z-index: -1;
}

.brand__wordmark {
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: clamp(30px, 6vw, 46px);
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--texto-reverso);
}

/* "Crossing Club" nunca parte; no desktop a marca fica em uma linha só. */
.brand__wordmark .wm-rest {
  white-space: nowrap;
}

.brand__device {
  width: min(320px, 78vw);
  height: auto;
}

.brand__tagline {
  font-family: var(--font-brand);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 3vw, 22px);
  letter-spacing: 0.01em;
  color: rgba(var(--reverso-rgb), 0.8);
}

/* ---- Indicadores do carrossel ------------------------------------------- */
/* Centralização por flex full-width (não por transform), para não conflitar
   com o transform do fade-in do chrome. */
.carousel-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.carousel-nav .tick {
  width: 24px;
  height: 2px;
  padding: 10px 0; /* alvo de clique alto; visual continua 2px */
  border-radius: 1px;
  background-color: rgba(var(--reverso-rgb), 0.25);
  background-clip: content-box;
  box-sizing: content-box;
  transition:
    width 360ms ease,
    background-color 360ms ease;
}

.carousel-nav .tick.is-active {
  width: 32px;
  background-color: rgba(var(--reverso-rgb), 0.9);
}

/* ---- Fade-in do chrome ao carregar (padrão IXC) ------------------------- */
.member-link,
.brand,
.carousel-nav {
  opacity: 0;
  transform: translateY(6px);
}

body.is-ready .member-link,
body.is-ready .brand,
body.is-ready .carousel-nav {
  opacity: 1;
  transform: none;
  transition:
    opacity 1400ms ease 200ms,
    transform 1400ms ease 200ms;
}

body.is-ready .carousel-nav {
  transition-delay: 500ms;
}

/* ---- Transição entre páginas (Home -> Member) --------------------------- */
/* Véu na cor de fundo: a Home esmaece para a tinta antes de navegar; o login
   surge na mesma tinta, dando a sensação de travessia. */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--fundo-profundo);
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

.page-veil.is-active {
  opacity: 1;
}

/* =============================================================================
   MEMBER AREA / LOGIN (member.html) — body.member
   ============================================================================= */
body.member {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
}

/* Botão voltar: seta discreta no topo-esquerdo (volta para a Home). */
.back-link {
  position: fixed;
  top: 34px;
  left: 40px;
  z-index: 2;
  display: inline-flex;
  padding: 8px;
  color: var(--texto-reverso);
  opacity: 0.5;
  transition: opacity 240ms ease;
}

.back-link:hover {
  opacity: 0.85;
}

/* brilho radial central levíssimo */
.login__glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    900px 520px at 50% 46%,
    rgba(var(--reverso-rgb), 0.05),
    rgba(var(--reverso-rgb), 0) 70%
  );
}

.login {
  position: relative;
  z-index: 1;
  width: 340px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* surge na tinta ao chegar da Home (fecha a transição de travessia) */
  animation: login-in 900ms ease both;
}

@keyframes login-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.login__C {
  display: block;
  width: auto;
  height: 104px;
  margin-bottom: 34px;
}

.login__form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.field {
  display: flex;
  flex-direction: column;
}

.field + .field {
  margin-top: 16px;
}

.field label {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(var(--reverso-rgb), 0.55);
  margin-bottom: 8px;
}

.field input {
  appearance: none;
  height: 30px;
  padding: 0;
  border: none;
  border-bottom: 1px solid rgba(var(--reverso-rgb), 0.3);
  border-radius: 0;
  background: transparent;
  color: var(--texto-reverso);
  caret-color: var(--texto-reverso);
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 15px;
  transition: border-color 200ms ease;
}

.field input:focus {
  outline: none;
  border-bottom-color: rgba(var(--reverso-rgb), 0.6);
}

/* mantém o autofill no tom escuro */
.field input:-webkit-autofill,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--texto-reverso);
  caret-color: var(--texto-reverso);
  transition: background-color 9999s ease-in-out 0s;
}

.login__enter {
  margin-top: 20px;
  width: 100%;
  padding: 11px;
  border: 1px solid rgba(var(--reverso-rgb), 0.3);
  border-radius: 3px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--texto-reverso);
  transition:
    border-color 240ms ease,
    background-color 240ms ease;
}

.login__enter:hover {
  border-color: rgba(var(--reverso-rgb), 0.55);
  background-color: rgba(var(--reverso-rgb), 0.04);
}

.login__notice {
  margin-top: 14px;
  min-height: 1.1em;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--marca-acento);
  opacity: 0;
  transition: opacity 400ms ease;
}

.login__notice.is-visible {
  opacity: 1;
}

/* =============================================================================
   Acessibilidade
   ============================================================================= */
a:focus-visible,
button:focus-visible {
  outline: 1px solid rgba(var(--reverso-rgb), 0.6);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================================================
   Responsivo (testar a 380px)
   ============================================================================= */
@media (max-width: 600px) {
  /* Member Area vira ícone sanduíche (alvo de toque 44px, sem caixa). */
  .member-link {
    top: 14px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 6px;
  }

  .member-link:hover {
    border-color: transparent;
  }

  .member-link__label {
    display: none;
  }

  .member-link__icon {
    display: block;
  }

  .brand {
    gap: 20px;
  }

  /* Vinheta mais leve no mobile: os valores fixos em px da box-shadow cobririam
     quase toda a tela estreita/alta e pesam demais no aparelho físico. */
  .vignette {
    background: rgba(0, 0, 0, 0.03);
    box-shadow: inset 0 0 110px 6px rgba(0, 0, 0, 0.5);
  }

  /* No mobile a marca quebra: "The" em cima, "Crossing Club" inteiro embaixo. */
  .brand__wordmark .wm-the,
  .brand__wordmark .wm-rest {
    display: block;
  }

  .carousel-nav {
    bottom: 36px;
  }

  .back-link {
    top: 16px;
    left: 12px;
  }
}
