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

:root {
  /* Mesma paleta de lib/sagax_theme.dart */
  --midnight-navy: #0F172A;
  --card-dark: #1E293B;
  --electric-cyan: #38BDF8;
  --soft-slate: #94A3B8;
  --snow-white: #F8FAFC;
  /* Acento roxo do brilho do logótipo */
  --neon-violet: #A855F7;
  --line: rgba(148, 163, 184, .15);
  --line-cyan: rgba(56, 189, 248, .15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--midnight-navy);
  color: var(--snow-white);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Exo 2', sans-serif; line-height: 1.25; }

a { color: var(--electric-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Language switcher */
.lang-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(56, 189, 248, .1);
}
.lang-bar button {
  font: inherit;
  padding: 4px 12px;
  border: 0;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--soft-slate);
  background: transparent;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.lang-bar button:hover { background: rgba(56, 189, 248, .1); color: var(--snow-white); }
.lang-bar button[aria-pressed="true"] { background: var(--electric-cyan); color: var(--midnight-navy); font-weight: 600; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 64px 16px 72px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 35%, rgba(168, 85, 247, .18), transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 15%, rgba(56, 189, 248, .14), transparent 70%),
    linear-gradient(180deg, #0F172A 0%, #162032 100%);
}
.hero .logo {
  max-width: 440px;
  width: 80%;
  height: auto;
  margin-bottom: 8px;
}
.hero .by {
  font-family: 'Exo 2', sans-serif;
  color: var(--electric-cyan);
  letter-spacing: .08em;
  margin-bottom: 24px;
}
.hero .tagline {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 16px;
}
.hero .description {
  max-width: 640px;
  margin: 0 auto 36px;
  font-size: 1.05rem;
  color: var(--soft-slate);
}

/* Store badges */
.badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.badges a { display: inline-block; line-height: 0; }
.badges a img {
  height: 52px;
  width: auto;
  border-radius: 8px;
  transition: transform .2s;
}
.badges a:hover img { transform: scale(1.05); }

/* Section */
.section {
  max-width: 960px;
  margin: 0 auto;
  padding: 64px 16px;
}
.section h2 {
  font-size: 1.75rem;
  margin-bottom: 12px;
  text-align: center;
  color: var(--electric-cyan);
}
.section .lead {
  max-width: 680px;
  margin: 0 auto 36px;
  text-align: center;
  color: var(--soft-slate);
}

/* Demo puzzle */
.demo {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.board {
  position: relative;
  width: 100%;
  aspect-ratio: 1832 / 858;
  background: #0b1222;
  border: 1px solid var(--line-cyan);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 0 40px rgba(56, 189, 248, .08), 0 0 80px rgba(168, 85, 247, .08);
  touch-action: manipulation;
}
.board-inner { position: relative; width: 100%; height: 100%; }
.tile {
  position: absolute;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: left .18s ease-out, top .18s ease-out, box-shadow .2s, filter .2s;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .35);
}
.tile:hover { filter: brightness(1.15); }
.tile.locked { cursor: default; }
.tile.locked:hover { filter: none; }
.board.solved .tile { box-shadow: none; border-radius: 0; }
.board.solved { box-shadow: 0 0 40px rgba(56, 189, 248, .25), 0 0 90px rgba(168, 85, 247, .25); }

.demo-side { display: flex; flex-direction: column; gap: 16px; }
.stats { display: flex; gap: 12px; }
.stat {
  flex: 1;
  background: var(--card-dark);
  border: 1px solid var(--line-cyan);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
}
.stat .label { display: block; font-size: .8rem; color: var(--soft-slate); }
.stat .value { display: block; font-family: 'Exo 2', sans-serif; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.demo-status { min-height: 1.7em; color: var(--soft-slate); }
.demo-status.win { color: var(--electric-cyan); font-weight: 600; }
.btn {
  font: 600 1rem 'Exo 2', sans-serif;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--electric-cyan);
  background: var(--electric-cyan);
  color: var(--midnight-navy);
  cursor: pointer;
  transition: transform .15s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--electric-cyan); }
.btn.ghost:hover { background: rgba(56, 189, 248, .1); }
.demo-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.demo-actions .btn { flex: 1; }

/* Level strip */
.levels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}
.level {
  background: var(--card-dark);
  border: 1px solid rgba(56, 189, 248, .25);
  border-radius: 12px;
  padding: 10px 4px;
  text-align: center;
}
.level b { display: block; font-family: 'Exo 2', sans-serif; font-size: 1.3rem; }
.level span { font-size: .75rem; color: var(--soft-slate); }

/* Benefits grid */
.benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.benefit-card {
  background: var(--card-dark);
  border: 1px solid var(--line-cyan);
  border-radius: 16px;
  padding: 28px 24px;
  transition: border-color .25s, transform .25s;
}
.benefit-card:hover { border-color: var(--electric-cyan); transform: translateY(-2px); }
.benefit-card .icon { font-size: 2rem; margin-bottom: 12px; line-height: 1; }
.benefit-card h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--electric-cyan); }
.benefit-card p { color: var(--soft-slate); font-size: 0.95rem; }

/* Features */
.features-list {
  list-style: none;
  max-width: 640px;
  margin: 0 auto;
}
.features-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
}
.features-list li .icon { font-size: 1.3rem; flex-shrink: 0; width: 1.6em; text-align: center; }

/* Screenshots */
.screenshots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.screenshots button {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 22px;
}
.screenshots img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 2856;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--line-cyan);
  background: var(--card-dark);
  transition: transform .2s, border-color .2s;
}
.screenshots button:hover img { transform: scale(1.03); border-color: var(--electric-cyan); }
.screenshots figcaption { text-align: center; color: var(--soft-slate); font-size: .9rem; margin-top: 10px; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(2, 6, 23, .9);
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 100%; max-width: 100%; border-radius: 24px; border: 1px solid var(--line-cyan); }

/* Footer */
footer {
  text-align: center;
  padding: 40px 16px;
  color: var(--soft-slate);
  font-size: 0.9rem;
  border-top: 1px solid rgba(148, 163, 184, .1);
}
.footer-logo {
  max-width: 160px;
  height: auto;
  margin-bottom: 16px;
  opacity: .85;
  transition: opacity .2s;
}
.footer-logo:hover { opacity: 1; }
.footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.credits { margin-top: 12px; font-size: .8rem; opacity: .8; }

/* Sub pages (privacy / contact) */
.container { max-width: 760px; margin: 0 auto; padding: 40px 16px 64px; }
.back-link { display: inline-block; margin-bottom: 24px; font-size: .95rem; }
.container h1 { font-size: 2rem; margin-bottom: 8px; }
.container h2 { font-size: 1.25rem; color: var(--electric-cyan); margin: 32px 0 12px; }
.container p, .container li { color: #CBD5E1; margin-bottom: 12px; }
.container ul { padding-left: 22px; margin-bottom: 12px; }
.container li { margin-bottom: 6px; }
.last-updated { color: var(--soft-slate) !important; font-size: .9rem; margin-bottom: 24px !important; }
.highlight {
  background: var(--card-dark);
  border-left: 4px solid var(--electric-cyan);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
}
.highlight p { margin: 0; }

.contact-wrap { display: flex; justify-content: center; padding: 64px 16px; }
.contact-card {
  width: 100%;
  max-width: 440px;
  background: var(--card-dark);
  border: 1px solid var(--line-cyan);
  border-radius: 20px;
  padding: 40px 28px;
  text-align: center;
}
.contact-card .logo { max-width: 200px; width: 70%; height: auto; margin-bottom: 20px; }
.contact-card h1 { font-size: 1.6rem; }
.divider { width: 60px; height: 3px; margin: 16px auto 24px; border-radius: 2px; background: linear-gradient(90deg, var(--electric-cyan), var(--neon-violet)); }
.contact-item { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; overflow-wrap: anywhere; }
.company-name { margin-top: 20px; color: var(--soft-slate); font-size: .9rem; }

@media (max-width: 760px) {
  .demo { grid-template-columns: 1fr; }
  .screenshots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .levels { gap: 8px; }
  .level b { font-size: 1.1rem; }
  .level span { font-size: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile, .benefit-card, .screenshots img, .btn, .badges a img { transition: none; }
}
