/* ==========================================================================
   Waydroid — landing "scroll-film"
   Sem framework, sem build step, sem CDN. Fontes de sistema apenas.
   Animações "scroll-driven" nativas (animation-timeline: view()/scroll())
   com fallback via classe .is-visible (aplicada por script.js com
   IntersectionObserver) para navegadores sem suporte.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Paleta — dark, tech, premium. Assinatura: âmbar/latão sobre verde-preto. */
  --bg: #0a0d0b;
  --bg-alt: #0e1310;
  --panel: #11160f;
  --panel-border: rgba(232, 224, 205, 0.09);
  --text: #eef1ec;
  --text-muted: #9aa39c;
  --text-dim: #6b746c;

  --accent: #cfa25a;         /* âmbar/latão — assinatura */
  --accent-strong: #e6bd77;
  --accent-soft: rgba(207, 162, 90, 0.14);
  --accent-line: rgba(207, 162, 90, 0.35);

  --mint: #6bd4a0;           /* verde sóbrio — indicadores/estados */
  --mint-soft: rgba(107, 212, 160, 0.14);

  --danger: #d97a6c;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

  --radius: 12px;
  --container: 1080px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #14110a;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------------------------- Scroll progress --------------------------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 900;
}
.scroll-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--mint));
  transform-origin: left;
}

@supports (animation-timeline: scroll()) {
  .scroll-progress__bar {
    animation: progress-scrub linear;
    animation-timeline: scroll(root);
  }
}
@keyframes progress-scrub {
  from { width: 0%; }
  to { width: 100%; }
}

/* --------------------------------- Header -------------------------------- */

.site-header {
  position: fixed;
  top: 2px;
  left: 0;
  right: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  background: linear-gradient(to bottom, rgba(10, 13, 11, 0.85), rgba(10, 13, 11, 0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand__mark { color: var(--accent); }
.brand__word { font-size: 1.05rem; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  font-size: 0.92rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--text); }

.site-nav__cta {
  border: 1px solid var(--accent-line);
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--accent-strong) !important;
  font-weight: 600;
  white-space: nowrap;
}
.site-nav__cta:hover { background: var(--accent-soft); }

@media (max-width: 640px) {
  .site-nav a:not(.site-nav__cta) { display: none; }
}

/* --------------------------------- Buttons -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #17130a;
}
.btn--primary:hover { background: var(--accent-strong); }
.btn--ghost {
  border-color: var(--panel-border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.btn--ghost:hover { border-color: var(--accent-line); color: var(--accent-strong); }
.btn--lg { padding: 16px 32px; font-size: 1.05rem; }

/* ---------------------------------- Scenes -------------------------------- */

.scene {
  position: relative;
  padding: clamp(72px, 14vh, 160px) clamp(16px, 5vw, 48px);
  overflow: hidden;
}

.scene__inner {
  max-width: var(--container);
  margin: 0 auto;
}
.scene__inner--center { text-align: center; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}

.scene__title {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
  max-width: 24ch;
}

.scene__lede {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 8px;
}
.scene__lede strong { color: var(--text); font-weight: 600; }

/* ------------------------------- Hero scene -------------------------------- */

.scene--hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(120px, 20vh, 200px);
  isolation: isolate;
}

.hero__stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero__grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(207, 162, 90, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(207, 162, 90, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 40%, black 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 40%, black 10%, transparent 75%);
}

.hero__glow {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.hero__glow--a {
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -25vmax;
  left: -10vmax;
}
.hero__glow--b {
  background: radial-gradient(circle, var(--mint) 0%, transparent 70%);
  bottom: -30vmax;
  right: -15vmax;
  opacity: 0.18;
}

@supports (animation-timeline: scroll()) {
  .hero__grid {
    animation: hero-grid-drift linear;
    animation-timeline: scroll(root);
    animation-range: 0 80vh;
  }
  .hero__glow--a {
    animation: hero-glow-a linear;
    animation-timeline: scroll(root);
    animation-range: 0 90vh;
  }
  .hero__glow--b {
    animation: hero-glow-b linear;
    animation-timeline: scroll(root);
    animation-range: 0 90vh;
  }
}

@keyframes hero-grid-drift {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(6%) scale(1.08); }
}
@keyframes hero-glow-a {
  from { transform: translate(0, 0) scale(1); opacity: 0.35; }
  to   { transform: translate(4%, 10%) scale(1.3); opacity: 0.1; }
}
@keyframes hero-glow-b {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-4%, -8%) scale(1.25); }
}

.hero__devices {
  position: absolute;
  inset: 0;
  display: none;
}
@media (min-width: 900px) {
  .hero__devices { display: block; }
}
.hero__device {
  position: absolute;
  width: 34px;
  height: 60px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: rgba(207, 162, 90, 0.04);
}
.hero__device::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(107, 212, 160, 0.35);
  border-radius: 3px;
}
.hero__device:nth-child(1) { top: 18%; left: 8%; transform: rotate(-8deg); }
.hero__device:nth-child(2) { top: 62%; left: 14%; transform: rotate(5deg); }
.hero__device:nth-child(3) { top: 30%; right: 10%; transform: rotate(7deg); }
.hero__device:nth-child(4) { top: 68%; right: 16%; transform: rotate(-6deg); }
.hero__device:nth-child(5) { top: 10%; right: 26%; transform: rotate(-3deg); }
.hero__device:nth-child(6) { top: 78%; left: 40%; transform: rotate(4deg); }

.hero__content {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}

.hero__title {
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  font-weight: 800;
  max-width: 18ch;
}

.hero__subtitle {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 0 36px;
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.hero__actions--center { justify-content: center; }

.hero__tags {
  list-style: none;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.hero__tags li {
  border: 1px solid var(--panel-border);
  padding: 6px 12px;
  border-radius: 999px;
}

.scroll-cue {
  position: absolute;
  bottom: clamp(20px, 4vh, 40px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scroll-cue__dot { animation: scroll-cue-bounce 1.8s ease-in-out infinite; }
@keyframes scroll-cue-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue__dot { animation: none; }
}
@media (max-width: 640px) {
  .scroll-cue { display: none; }
}

/* ------------------------------ Reveal system ------------------------------ */
/* Estado inicial: oculto/deslocado. Duas formas de revelar:
   1) animation-timeline: view()  — nativo, sem JS.
   2) classe .is-visible aplicada via IntersectionObserver (script.js). */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@supports (animation-timeline: view()) {
  [data-reveal] {
    transition: none;
    animation: reveal-in linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 32%;
  }
  /* Se o navegador suporta view(), a classe JS de fallback não é necessária,
     mas não atrapalha caso ambas coexistam. */
}

@keyframes reveal-in {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger simples para grupos de itens revelados juntos */
.features .feature:nth-child(2),
.security-list li:nth-child(2) { transition-delay: 0.06s; }
.features .feature:nth-child(3),
.security-list li:nth-child(3) { transition-delay: 0.12s; }
.features .feature:nth-child(4),
.security-list li:nth-child(4) { transition-delay: 0.18s; }
.features .feature:nth-child(5),
.security-list li:nth-child(5) { transition-delay: 0.24s; }
.features .feature:nth-child(6) { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}

/* --------------------------------- Compare --------------------------------- */

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
}
@media (max-width: 700px) {
  .compare { grid-template-columns: 1fr; }
}

.compare__col {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--panel);
}
.compare__col h3 { margin: 0 0 16px; font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.compare__col--good { border-color: var(--accent-line); }
.compare__col--good h3 { color: var(--accent-strong); }

.compare__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.compare__col li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; }

.icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; }
.icon--x { color: var(--danger); }
.icon--check { color: var(--mint); }

/* --------------------------------- Diagram --------------------------------- */

.diagram {
  width: 100%;
  height: auto;
  margin-top: 44px;
  overflow: visible;
}

.diagram__box { fill: var(--panel); stroke: var(--panel-border); stroke-width: 1.4; }
.diagram__box--core { fill: var(--accent-soft); stroke: var(--accent-line); }
.diagram__box--tenant { stroke: var(--panel-border); }
.diagram__box--device { fill: rgba(107, 212, 160, 0.08); stroke: rgba(107, 212, 160, 0.4); }
.diagram__box--lock { fill: rgba(207, 162, 90, 0.1); stroke: var(--accent-line); }

.diagram__label {
  font-family: var(--font-mono);
  font-size: 12px;
  fill: var(--text);
}
.diagram__label--tenant { fill: var(--text-muted); }

.diagram__line {
  fill: none;
  stroke: var(--accent-line);
  stroke-width: 1.4;
  stroke-dasharray: 6 5;
}

@supports (animation-timeline: view()) {
  .diagram {
    animation: none; /* o SVG em si não anima, só os filhos abaixo */
  }
  .diagram__line {
    stroke-dashoffset: 60;
    animation: diagram-draw linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 55%;
  }
}
@keyframes diagram-draw {
  from { stroke-dashoffset: 60; }
  to   { stroke-dashoffset: 0; }
}

.diagram__caption {
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* --------------------------------- Features --------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}
@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .features { grid-template-columns: 1fr; }
}

.feature {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--panel);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.feature:hover { border-color: var(--accent-line); transform: translateY(-2px); }

.feature__icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 16px; }
.feature h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* ------------------------------- Security list ------------------------------- */

.security-list {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--panel-border);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.security-list li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  background: var(--panel);
}
.security-list__icon {
  width: 22px;
  height: 22px;
  color: var(--mint);
  flex-shrink: 0;
  margin-top: 2px;
}
.security-list h3 { margin: 0 0 4px; font-size: 1rem; }
.security-list p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* ---------------------------------- CTA final --------------------------------- */

.scene--cta {
  background: radial-gradient(ellipse 80% 60% at 50% 30%, var(--accent-soft), transparent 70%);
}
.cta__title {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.scene--cta .scene__lede { margin-left: auto; margin-right: auto; }

/* ---------------------------------- Footer --------------------------------- */

.site-footer {
  border-top: 1px solid var(--panel-border);
  padding: 32px clamp(16px, 5vw, 48px) 48px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.site-footer p { margin: 0 0 6px; }
.site-footer strong { color: var(--text-muted); }
.site-footer__meta { font-family: var(--font-mono); font-size: 0.75rem; }

/* ------------------------------ Mobile simplification ------------------------------ */
/* "O filme" continua no mobile, porém com menos camadas de parallax
   para manter performance em aparelhos mais fracos. */
@media (max-width: 640px) {
  .hero__glow { filter: blur(50px); }
  @supports (animation-timeline: scroll()) {
    .hero__grid, .hero__glow--a, .hero__glow--b { animation: none; }
  }
  .scene { padding-top: 56px; padding-bottom: 56px; }
}
