/* =========================================================
   Kairós Energia Solar — página de links
   Mobile first · HTML/CSS/JS puro · sem dependências
   ========================================================= */

:root {
  --navy-950: #050a2e;
  --navy-900: #0a1150;
  --navy-800: #121a7a;
  --navy-700: #1b2696;
  --gold-300: #ffe29a;
  --gold-400: #ffd166;
  --gold-500: #f7b928;
  --gold-600: #e09a12;
  --white: #ffffff;
  --text-soft: rgba(235, 240, 255, 0.78);
  --glass: rgba(255, 255, 255, 0.075);
  --glass-strong: rgba(255, 255, 255, 0.11);
  --glass-line: rgba(255, 255, 255, 0.16);
  --radius: 22px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.45, 0, 0.25, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--navy-950);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--white);
  background: var(--navy-950);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

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

/* ---------------------------------------------------------
   Fundo em camadas
   --------------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--navy-900);
}

.bg__parallax {
  position: absolute;
  inset: -6%;
  will-change: transform;
  transition: transform 1.2s var(--ease-out);
}

.bg__photo {
  position: absolute;
  inset: 0;
  background: url("assets/fundo-solar.webp") center 62% / cover no-repeat;
  transform-origin: 70% 30%;
  animation: kenburns 38s var(--ease-soft) infinite alternate;
  will-change: transform;
}

@keyframes kenburns {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.14) translate3d(-1.5%, 1.2%, 0); }
}

.bg__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(10, 17, 80, 0.35) 0%, rgba(10, 17, 80, 0) 60%),
    linear-gradient(180deg,
      rgba(7, 16, 82, 0.84) 0%,
      rgba(9, 20, 96, 0.60) 32%,
      rgba(8, 16, 80, 0.70) 62%,
      rgba(4, 9, 46, 0.93) 100%);
}

/* brilho solar no canto superior */
.bg__sun {
  position: absolute;
  top: -22vmax;
  right: -20vmax;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 210, 100, 0.34) 0%,
    rgba(247, 185, 40, 0.12) 28%,
    rgba(247, 185, 40, 0) 65%);
  mix-blend-mode: screen;
  animation: sunPulse 9s var(--ease-soft) infinite alternate;
}

@keyframes sunPulse {
  from { opacity: 0.75; transform: scale(1); }
  to   { opacity: 1;    transform: scale(1.08); }
}

/* raios de luz suaves */
.bg__rays {
  position: absolute;
  top: -40%;
  right: -30%;
  width: 140%;
  height: 140%;
  background: repeating-conic-gradient(from 200deg at 85% 8%,
    rgba(255, 210, 110, 0.00) 0deg,
    rgba(255, 210, 110, 0.07) 3deg,
    rgba(255, 210, 110, 0.00) 7deg,
    rgba(255, 210, 110, 0.00) 13deg);
  -webkit-mask-image: radial-gradient(70% 60% at 85% 8%, #000 0%, transparent 75%);
          mask-image: radial-gradient(70% 60% at 85% 8%, #000 0%, transparent 75%);
  mix-blend-mode: screen;
  opacity: 0.9;
  animation: rays 24s linear infinite alternate;
}

@keyframes rays {
  from { transform: rotate(-2deg); opacity: 0.55; }
  to   { transform: rotate(3deg);  opacity: 0.95; }
}

.bg__sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* granulação fina para um acabamento fotográfico */
.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ---------------------------------------------------------
   Estrutura
   --------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 34px)
    calc(env(safe-area-inset-right, 0px) + 20px)
    calc(env(safe-area-inset-bottom, 0px) + 24px)
    calc(env(safe-area-inset-left, 0px) + 20px);
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------
   Cabeçalho
   --------------------------------------------------------- */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-wrap {
  position: relative;
  width: min(74vw, 300px);
  margin: 0 auto 22px;
}

.logo {
  position: relative;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(2, 5, 30, 0.55))
          drop-shadow(0 0 18px rgba(255, 200, 80, 0.12));
  animation: float 6.5s var(--ease-soft) infinite;
  will-change: transform;
}

.logo-halo {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 78%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 205, 90, 0.30) 0%,
    rgba(255, 190, 60, 0.10) 40%,
    rgba(255, 190, 60, 0) 70%);
  filter: blur(6px);
  animation: halo 6.5s var(--ease-soft) infinite;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -9px, 0); }
}

@keyframes halo {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(0.96); }
  50%      { opacity: 1;    transform: translate(-50%, -54%) scale(1.04); }
}

.headline {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(1.6rem, 7.2vw, 2.15rem);
  line-height: 1.14;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(3, 6, 40, 0.55);
}

.gold {
  background: linear-gradient(100deg, var(--gold-300) 0%, var(--gold-500) 45%, var(--gold-600) 70%, var(--gold-300) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold-500);
  animation: goldShift 6s linear infinite;
  text-shadow: none;
  filter: drop-shadow(0 0 14px rgba(247, 185, 40, 0.35));
}

@keyframes goldShift {
  from { background-position: 0% 50%; }
  to   { background-position: 220% 50%; }
}

.subline {
  margin: 14px 0 0;
  max-width: 32ch;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-soft);
  letter-spacing: 0.005em;
}

.subline .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.6);
  vertical-align: middle;
  animation: ping 2.6s ease-out infinite;
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 209, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0); }
}

/* ---------------------------------------------------------
   Botões — glassmorphism
   --------------------------------------------------------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  --lift: 0px;
  --press: 1;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 16px 14px 14px;
  border-radius: var(--radius);
  color: var(--white);
  text-decoration: none;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 48%, rgba(255, 255, 255, 0.03) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
          backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 10px 26px -10px rgba(2, 4, 30, 0.75),
    0 2px 6px rgba(2, 4, 30, 0.25);
  transform: translate3d(0, var(--lift), 0) scale(var(--press));
  transition:
    transform 0.45s var(--ease-out),
    box-shadow 0.45s var(--ease-out),
    background-color 0.3s ease,
    border-color 0.3s ease;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* contorno luminoso que percorre a borda */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1.2px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle),
    transparent 0deg,
    transparent 250deg,
    rgba(255, 214, 120, 0.0) 270deg,
    rgba(255, 220, 140, 0.95) 320deg,
    rgba(255, 255, 255, 0.9) 335deg,
    rgba(255, 214, 120, 0.0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: borderSpin 7s linear infinite;
  opacity: 0.55;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

/* reflexo dourado que atravessa o vidro */
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  z-index: -1;
  background: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 232, 170, 0.16) 45%,
    rgba(255, 255, 255, 0.26) 50%,
    rgba(255, 232, 170, 0.12) 55%,
    rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg) translateX(0);
  pointer-events: none;
  animation: sheen 9s var(--ease-soft) infinite;
}

.links .btn:nth-child(1)::before { animation-delay: 0s; }
.links .btn:nth-child(2)::before { animation-delay: -1.75s; }
.links .btn:nth-child(3)::before { animation-delay: -3.5s; }
.links .btn:nth-child(4)::before { animation-delay: -5.25s; }

.links .btn:nth-child(1)::after { animation-delay: 1.6s; }
.links .btn:nth-child(2)::after { animation-delay: 2.0s; }
.links .btn:nth-child(3)::after { animation-delay: 2.4s; }
.links .btn:nth-child(4)::after { animation-delay: 2.8s; }

@keyframes borderSpin {
  to { --angle: 360deg; }
}

@keyframes sheen {
  0%   { transform: skewX(-18deg) translateX(0); }
  22%  { transform: skewX(-18deg) translateX(420%); }
  100% { transform: skewX(-18deg) translateX(420%); }
}

/* flutuação discreta e defasada */
.btn.is-in { animation: bob 7s var(--ease-soft) infinite; }
.links .btn:nth-child(2).is-in { animation-delay: -1.8s; }
.links .btn:nth-child(3).is-in { animation-delay: -3.6s; }
.links .btn:nth-child(4).is-in { animation-delay: -5.2s; }

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -3px; }
}

.btn__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 6px 14px -4px rgba(0, 0, 0, 0.45);
  transition: transform 0.5s var(--ease-out);
}

.btn__icon--whatsapp {
  background: linear-gradient(160deg, #5ef08a 0%, #25d366 45%, #128c4b 100%);
}

.btn__icon--instagram {
  background:
    radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.btn__icon--google,
.btn__icon--maps {
  background: linear-gradient(160deg, #ffffff 0%, #eef1f8 100%);
}

.btn__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.btn__label {
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  line-height: 1.25;
}

.btn__hint {
  font-size: 0.8rem;
  line-height: 1.3;
  color: rgba(225, 232, 255, 0.66);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn__arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0.85;
  transition: transform 0.45s var(--ease-out), background-color 0.3s ease, opacity 0.3s ease;
}

.btn__arrow img { width: 16px; height: 16px; }

/* destaque do WhatsApp */
.btn--whatsapp {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(37, 211, 102, 0.20) 0%, rgba(37, 211, 102, 0) 55%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.17) 0%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(255, 214, 120, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(255, 209, 102, 0.06),
    0 12px 32px -10px rgba(2, 4, 30, 0.8),
    0 0 34px -8px rgba(247, 185, 40, 0.38);
  min-height: 82px;
}

.btn--whatsapp::before { opacity: 0.95; animation-duration: 5s; }
.btn--whatsapp .btn__label { font-size: 1.06rem; font-weight: 700; }
.btn--whatsapp .btn__hint { color: rgba(255, 226, 154, 0.9); }
.btn--whatsapp .btn__arrow {
  background: linear-gradient(160deg, var(--gold-400), var(--gold-600));
  border-color: rgba(255, 236, 180, 0.6);
  opacity: 1;
  box-shadow: 0 4px 14px -4px rgba(247, 185, 40, 0.7);
}

.btn--whatsapp .btn__icon {
  position: relative;
}

.btn--whatsapp .btn__icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 1.5px solid rgba(37, 211, 102, 0.55);
  animation: iconPulse 2.8s ease-out infinite;
}

@keyframes iconPulse {
  0%   { transform: scale(0.92); opacity: 0.9; }
  80%  { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* interações */
@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    --lift: -4px;
    border-color: rgba(255, 220, 140, 0.38);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 18px 40px -14px rgba(2, 4, 30, 0.85),
      0 0 30px -6px rgba(247, 185, 40, 0.35);
  }
  .btn:hover::before { opacity: 1; }
  .btn:hover .btn__icon { transform: scale(1.06) rotate(-3deg); }
  .btn:hover .btn__arrow { transform: translateX(4px); opacity: 1; background-color: rgba(255, 255, 255, 0.16); }
  .btn--whatsapp:hover .btn__arrow { background-color: transparent; }
}

.btn:active,
.btn.is-pressed {
  --press: 0.975;
  transition-duration: 0.12s;
}

.btn:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
}

/* ondulação de toque */
.ripple {
  position: absolute;
  z-index: -1;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 154, 0.55) 0%, rgba(255, 226, 154, 0) 70%);
  transform: scale(0);
  animation: ripple 0.75s var(--ease-out) forwards;
  pointer-events: none;
}

@keyframes ripple {
  to { transform: scale(48); opacity: 0; }
}

/* botão de localização ainda sem link */
.btn.is-disabled {
  cursor: default;
  opacity: 0.72;
}
.btn.is-disabled .btn__arrow { opacity: 0.35; }
.btn.is-disabled:hover { --lift: 0px; }

/* ---------------------------------------------------------
   Rodapé
   --------------------------------------------------------- */
.footer {
  margin-top: auto;
  padding-top: 44px;
  text-align: center;
}

.footer__line {
  display: block;
  width: 56px;
  height: 1px;
  margin: 0 auto 16px;
  background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.7), transparent);
}

.footer__brand {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.footer__rights {
  margin: 6px 0 0;
  font-size: 0.74rem;
  color: rgba(220, 228, 255, 0.5);
}

/* ---------------------------------------------------------
   Entrada sequencial
   --------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  filter: blur(6px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out),
    filter 0.9s var(--ease-out);
}

.reveal.btn { transform: translate3d(0, 22px, 0) scale(0.98); }

.is-ready .reveal {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

.is-ready .reveal.btn {
  transform: translate3d(0, var(--lift), 0) scale(var(--press));
}

.r1 { transition-delay: 0.05s; }
.r2 { transition-delay: 0.22s; }
.r3 { transition-delay: 0.34s; }
.r4 { transition-delay: 0.48s; }
.r5 { transition-delay: 0.58s; }
.r6 { transition-delay: 0.68s; }
.r7 { transition-delay: 0.78s; }
.r8 { transition-delay: 0.95s; }

/* depois da entrada, as interações ficam imediatas */
.is-settled .reveal { transition-delay: 0s; }
.is-settled .reveal.btn {
  transition:
    transform 0.45s var(--ease-out),
    box-shadow 0.45s var(--ease-out),
    border-color 0.3s ease,
    opacity 0.3s ease;
  filter: none;
}

/* sem JavaScript: mostra tudo */
.no-js .reveal { opacity: 1; transform: none; filter: none; }

/* ---------------------------------------------------------
   Telas maiores
   --------------------------------------------------------- */
@media (min-width: 400px) {
  .btn { padding: 16px 18px 16px 16px; gap: 16px; }
}

@media (min-width: 768px) {
  .page {
    max-width: 520px;
    padding-top: 64px;
    padding-bottom: 32px;
  }
  .logo-wrap { width: 320px; margin-bottom: 26px; }
  .headline { font-size: 2.4rem; }
  .subline { font-size: 1.02rem; }
  .links { gap: 16px; margin-top: 42px; }
  .btn { min-height: 80px; }
  .btn--whatsapp { min-height: 86px; }
  .bg__overlay {
    background:
      radial-gradient(60% 90% at 50% 45%, rgba(10, 17, 84, 0.55) 0%, rgba(8, 13, 66, 0.0) 70%),
      linear-gradient(180deg,
        rgba(7, 16, 82, 0.80) 0%,
        rgba(9, 20, 96, 0.62) 40%,
        rgba(4, 9, 46, 0.92) 100%);
  }
  .bg__photo { background-position: center 24%; }
}

@media (max-height: 640px) and (max-width: 480px) {
  .page { padding-top: calc(env(safe-area-inset-top, 0px) + 20px); }
  .logo-wrap { width: min(60vw, 230px); margin-bottom: 14px; }
  .links { margin-top: 24px; gap: 12px; }
  .btn { min-height: 68px; }
  .btn--whatsapp { min-height: 72px; }
}

@media (max-width: 340px) {
  .btn__label { font-size: 0.95rem; }
  .btn__hint { white-space: normal; }
  .btn--whatsapp .btn__label { font-size: 0.98rem; }
  .btn__icon { width: 42px; height: 42px; border-radius: 13px; }
  .btn__arrow { width: 28px; height: 28px; }
}

/* sem suporte a backdrop-filter: vidro mais opaco para manter a leitura */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .btn { background: rgba(20, 28, 100, 0.82); }
}

/* ---------------------------------------------------------
   Acessibilidade — redução de movimento
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .bg__photo { transform: scale(1.04); }
  .bg__sparks { display: none; }
  .btn::after { display: none; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
