/* ==========================================================================
   ae studio · coming soon
   Estrutura: 1) tokens  2) base  3) fundo (luz de janela)  4) layout
              5) logo  6) formulário  7) botão cromado  8) animações  9) responsivo
   ========================================================================== */

/* 1) Tokens ------------------------------------------------------------- */
:root {
  --ink: #0b0b0d;          /* preto obsidiana */
  --ink-soft: #5a5f69;     /* grafite suavizado */
  --graphite: #2a2d33;
  --paper: #f1f0f5;
  --paper-shade: #e3e1e8;
  --line: rgba(11, 11, 13, .28);
  --accent-sky: #8fb8d6;

  --chrome: linear-gradient(135deg, #f4f5f7 0%, #9aa3b0 30%, #3a3f48 52%, #c9ced6 70%, #6b7280 100%);
  --chrome-liquid:
    radial-gradient(70% 55% at 22% 8%, rgba(255, 255, 255, .95), transparent 60%),
    radial-gradient(45% 70% at 82% 30%, rgba(255, 255, 255, .55), transparent 70%),
    radial-gradient(90% 55% at 55% 100%, rgba(52, 56, 66, .6), transparent 70%),
    radial-gradient(40% 40% at 10% 85%, rgba(52, 56, 66, .35), transparent 70%),
    linear-gradient(180deg, #f2f3f5 0%, #c3c8d0 28%, #858c99 52%, #dfe2e7 76%, #9aa1ad 100%);

  --font: "Helios", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --radius: 6px;
}

/* 2) Base --------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nowrap { white-space: nowrap; }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* 3) Fundo: sombra de luz de janela -------------------------------------- */
.window-light {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(90% 70% at 15% 10%, rgba(0, 0, 0, .05), transparent 60%),
    linear-gradient(180deg, #dfdde5 0%, #d6d4dd 100%);
}

/* Moldura de janela projetada: os vãos claros são a luz, os espaços entre eles são a sombra dos caixilhos */
.window {
  position: absolute;
  left: 14%;
  top: -18%;
  width: 96vw;
  height: 140vh;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1.1fr 1fr;
  gap: clamp(30px, 3.6vw, 64px);
  transform: skewX(-6deg) skewY(-14deg);
  transform-origin: 0 0;
  filter: blur(16px);
  animation: drift 32s ease-in-out infinite alternate;
}
.pane {
  background: linear-gradient(160deg, rgba(248, 248, 252, .96), rgba(240, 240, 246, .85));
  border-radius: 2px;
}

/* 4) Layout -------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(28px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}

.site-header { text-align: center; padding-top: clamp(8px, 4vh, 40px); }

.wordmark {
  margin: 0;
  font-size: clamp(1.1rem, .95rem + .9vw, 1.6rem);
  font-weight: 200;
  letter-spacing: .42em;
  padding-left: .42em; /* compensa o espaçamento após a última letra */
  text-transform: lowercase;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding-block: clamp(16px, 4vh, 48px);
  text-align: center;
}

.copy { margin-top: clamp(8px, 2vh, 24px); }

.headline {
  margin: 0;
  font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.9rem);
  font-weight: 300;
  letter-spacing: -.015em;
  line-height: 1.1;
}

.subline {
  margin: .5rem 0 0;
  font-size: clamp(1rem, .9rem + .5vw, 1.25rem);
  font-weight: 300;
  letter-spacing: .01em;
  color: var(--ink-soft);
}

.hint {
  margin: 1.4rem 0 0;
  font-size: .8125rem;
  letter-spacing: .02em;
  color: var(--ink-soft);
}

.status {
  min-height: 1.5em;
  margin: .5rem 0 0;
  font-size: .9375rem;
  font-weight: 500;
}
.status[data-state="success"] { color: #1f6b44; }
.status[data-state="error"]   { color: #a02f3c; }

.site-footer { text-align: center; padding-top: 12px; }
.site-footer nav {
  display: inline-flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.site-footer a {
  color: var(--ink);
  font-weight: 300;
  text-decoration: none;
  font-size: 1rem;
  padding: 6px 2px;
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s var(--ease);
}
.site-footer a:hover,
.site-footer a:focus-visible { background-size: 100% 1px; }

.noscript {
  position: fixed; left: 0; right: 0; bottom: 56px; z-index: 2;
  margin: 0; text-align: center; font-size: .875rem; color: var(--ink-soft);
}

/* 4b) Página de privacidade --------------------------------------------- */
.wordmark--link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  transition: opacity .3s var(--ease);
}
.wordmark--link:hover { opacity: .6; }

.legal {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-block: clamp(32px, 7vh, 72px) clamp(24px, 5vh, 48px);
}

.legal__head { text-align: center; }
.legal__mark {
  width: 56px;
  height: auto;
  margin: 0 auto 18px;
  filter: drop-shadow(0 8px 10px rgba(30, 32, 40, .16));
}
.legal__head .subline { margin-top: .4rem; }

.legal__body {
  margin-top: clamp(32px, 6vh, 56px);
  padding: clamp(24px, 4vw, 40px);
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(11, 11, 13, .08);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}

.legal section + section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(11, 11, 13, .08);
}

.legal h2 {
  margin: 0 0 6px;
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .2em;
  color: var(--ink-soft);
}

.legal p {
  margin: 0;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink);
}

.legal__mail {
  color: var(--ink);
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: opacity .3s var(--ease);
}
.legal__mail:hover { opacity: .6; }

.legal .legal__updated {
  margin-top: 28px;
  font-size: .8125rem;
  color: var(--ink-soft);
}

.legal__back {
  display: table;
  margin: 28px auto 0;
  padding: 6px 2px;
  font-size: .9375rem;
  font-weight: 300;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s var(--ease);
}
.legal__back:hover,
.legal__back:focus-visible { background-size: 100% 1px; }

.site-footer a[aria-current="page"] { background-size: 100% 1px; }

/* 5) Logo ---------------------------------------------------------------- */
.logo {
  position: relative;
  margin: 0;
  width: clamp(200px, 26vw, 290px);
  aspect-ratio: 1052 / 1066;
}

/* flutuação e sombra ficam num wrapper interno para não brigar com a animação de entrada */
.logo-float {
  position: absolute;
  inset: 0;
  animation: float 7s ease-in-out infinite;
  filter: drop-shadow(0 24px 26px rgba(30, 32, 40, .2)) drop-shadow(0 4px 6px rgba(30, 32, 40, .12));
}

.logo-img,
.logo-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.logo-img { z-index: 1; }
.logo-fallback { display: none; }
.logo.is-fallback .logo-img { display: none; }
.logo.is-fallback .logo-fallback { display: block; }

/* 6) Formulário ---------------------------------------------------------- */
.waitlist {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin-top: clamp(20px, 3.4vh, 36px);
}

.field { flex: 1 1 auto; max-width: 300px; min-width: 0; }

.field input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  font: inherit;
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink);
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 2px rgba(20, 22, 28, .06);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease), transform .25s var(--ease);
  appearance: none;
}
.field input::placeholder { color: rgba(42, 45, 51, .5); opacity: 1; }

.field input:hover { background: rgba(255, 255, 255, .9); }

.field input:focus {
  outline: none;
  background: #fff;
  border-color: var(--ink);
  box-shadow:
    0 0 0 3px rgba(143, 184, 214, .45),
    0 8px 24px rgba(30, 32, 40, .12);
  transform: translateY(-1px);
}

.field input[aria-invalid="true"] {
  border-color: #a02f3c;
  box-shadow: 0 0 0 3px rgba(160, 47, 60, .16);
  animation: shake .4s var(--ease);
}

/* 7) Botão cromado líquido --------------------------------------------- */
/* O metal (com o escorrido) é o asset assets/button-chrome.*; o texto é HTML,
   então dá para trocar o rótulo sem refazer a imagem. A área "sólida" do botão
   ocupa ~70% da altura; os 30% de baixo são o escorrido. */
.chrome-btn {
  --btn-w: 196px; /* corpo ≈ 46px, igual ao input */
  --body: 70%;
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  width: var(--btn-w);
  aspect-ratio: 1001 / 332;
  padding: 0;
  font: inherit;
  font-size: .9375rem;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--ink);
  cursor: pointer;
  border: 0;
  background: url("assets/button-chrome.webp") center / 100% 100% no-repeat;
  /* metal mais claro e suave: menos contraste = mais delicado */
  filter: brightness(1.1) contrast(.86) drop-shadow(0 5px 7px rgba(30, 32, 40, .14));
  transition: transform .35s var(--ease), filter .35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.chrome-btn__label,
.chrome-btn__spinner { position: absolute; }

.chrome-btn__label {
  inset: 0 0 auto 0;
  height: var(--body);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

/* brilho que atravessa o metal, recortado no formato do botão */
.chrome-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .9) 50%, transparent 62%);
  background-size: 260% 100%;
  background-position: 160% 0;
  -webkit-mask: url("assets/button-chrome.webp") center / 100% 100% no-repeat;
          mask: url("assets/button-chrome.webp") center / 100% 100% no-repeat;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.chrome-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.14) contrast(.9) drop-shadow(0 9px 12px rgba(30, 32, 40, .18));
}
.chrome-btn:hover::before { animation: sheen 1s var(--ease) 1; }

.chrome-btn:active {
  transform: translateY(1px) scale(.98);
  filter: brightness(1.04) contrast(.86) drop-shadow(0 3px 4px rgba(30, 32, 40, .14));
}

.chrome-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 14px;
}

.chrome-btn__spinner {
  display: none;
  left: calc(50% - 10px);
  top: calc(var(--body) / 2 - 10px);
  width: 20px; height: 20px;
  border: 2px solid rgba(14, 15, 18, .25);
  border-top-color: #0e0f12;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.chrome-btn[aria-busy="true"] { cursor: progress; }
.chrome-btn[aria-busy="true"] .chrome-btn__label { opacity: 0; }
.chrome-btn[aria-busy="true"] .chrome-btn__spinner { display: block; }
.chrome-btn:disabled:not([aria-busy="true"]) { cursor: default; filter: grayscale(.2) brightness(.97); transform: none; }

/* 8) Animações ----------------------------------------------------------- */
/* Estado inicial só quando o JS roda (evita conteúdo invisível sem JS) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(6px);
}
.js.is-ready [data-reveal] {
  opacity: 1;
  transform: none;
  filter: none;
  transition:
    opacity .9s var(--ease) var(--d, 0ms),
    transform .9s var(--ease) var(--d, 0ms),
    filter .9s var(--ease) var(--d, 0ms);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes drift {
  from { translate: -2vw 0; }
  to   { translate: 3vw 2vh; }
}
@keyframes sheen { to { background-position: -60% 0; } }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes shake {
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
}

/* 9) Responsivo ---------------------------------------------------------- */
@media (max-width: 600px) {
  .waitlist {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    max-width: 380px;
  }
  .field { max-width: none; }
  .chrome-btn { align-self: center; --btn-w: min(100%, 220px); } /* mantém a proporção do metal */
  .hint { margin-top: 1.8rem; }
  .window { left: -30%; width: 170vw; height: 110vh; filter: blur(12px); }
}

@media (max-height: 560px) and (orientation: landscape) {
  .logo { width: clamp(120px, 20vw, 190px); }
  .stage { padding-block: 8px; }
  .hint { margin-top: .8rem; }
}

/* iOS: evita zoom ao focar o input */
@supports (-webkit-touch-callout: none) {
  .field input { font-size: 16px; }
}

@media (forced-colors: active) {
  .chrome-btn { border: 2px solid ButtonText; background: ButtonFace; color: ButtonText; text-shadow: none; box-shadow: none; }
  .chrome-btn::before { display: none; }
}

/* listas na página de privacidade e link no aviso do formulário */
.legal ul {
  margin: 0 0 .6rem;
  padding-left: 1.1rem;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink);
}
.legal li + li { margin-top: .25rem; }
.legal section p + p, .legal ul + p { margin-top: .6rem; }
.hint a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.hint a:hover, .hint a:focus-visible { opacity: .6; }
