:root {
  --bg: #1c0820;
  --bg-2: #2b0c31;
  --text: #f6f1f7;
  --muted: #c9b6cd;
  --purple: #3a0f44;
  --magenta: #c2186a;
  --orange: #e8820c;
  --yellow: #e2b400;
  --lime: #9cc21a;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, var(--bg-2) 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 48px) 16px 48px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero {
  /* encolhe a imagem em ecrãs baixos para o texto caber sem scroll */
  width: clamp(min(100%, 480px), (100vh - 340px) * 16 / 9, 100%);
  width: clamp(min(100%, 480px), (100dvh - 340px) * 16 / 9, 100%);
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
  background: var(--purple);
}

.hero {
  position: relative;
  aspect-ratio: 16 / 9;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* Canvas 3D por cima da imagem; a imagem fica como poster até ao primeiro frame */
.hero .scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity .8s ease;
  cursor: crosshair;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Contador do mini-jogo e dica, por cima da cena */
.hud, .hint {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  font-family: "Chakra Petch", "DM Sans", sans-serif;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.hud {
  top: clamp(8px, 2%, 16px);
  left: clamp(10px, 2%, 18px);
  padding: .3em .7em;
  border-radius: 999px;
  background: rgba(28, 8, 32, .55);
  color: #ffd23a;
  font-size: clamp(.8rem, 1.8vw, 1rem);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .3s ease, transform .3s ease, background-color .3s ease, color .3s ease;
}
.hud.show { opacity: 1; transform: none; }
.hud.win { background: #ffd23a; color: #1c0820; text-shadow: none; }
.hint {
  left: 0;
  right: 0;
  bottom: clamp(6px, 2.5%, 14px);
  text-align: center;
  font-size: clamp(.65rem, 1.5vw, .82rem);
  font-weight: 600;
  letter-spacing: .04em;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero.is-live .hint { opacity: .8; }
.hero.is-live .hint.gone { opacity: 0; }
.hero.is-live .scene { opacity: 1; }

.stripe {
  display: flex;
  height: 6px;
  margin: clamp(24px, 4vw, 40px) auto 0;
  width: min(220px, 50%);
  border-radius: 3px;
  overflow: hidden;
}
.stripe span { flex: 1; }
.stripe span:nth-child(1) { background: var(--purple); }
.stripe span:nth-child(2) { background: var(--magenta); }
.stripe span:nth-child(3) { background: var(--orange); }
.stripe span:nth-child(4) { background: var(--yellow); }
.stripe span:nth-child(5) { background: var(--lime); }

.intro {
  text-align: center;
  padding-top: clamp(16px, 3vw, 28px);
}

h1 {
  margin: 0;
  font-family: "Chakra Petch", "DM Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
h1 sup {
  font-size: .5em;
  color: var(--lime);
  vertical-align: super;
  line-height: 0;
  margin-left: .04em;
}

.lead {
  margin: .6em 0 0;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  font-weight: 500;
}

.areas {
  margin: .35em 0 0;
  color: var(--muted);
  font-size: clamp(.9rem, 2vw, 1rem);
  letter-spacing: .04em;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  margin-top: 1.6em;
  padding: .8em 1.6em;
  border-radius: 999px;
  background: var(--lime);
  color: #17200a;
  font-family: "Chakra Petch", "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  transition: transform .15s ease, background-color .15s ease;
}
.cta:hover { background: #b2d92a; transform: translateY(-2px); }
.cta:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.mail {
  margin: 1em 0 0;
  font-size: .9rem;
}
.mail a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 182, 205, .35);
}
.mail a:hover { color: var(--text); border-color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .cta { transition: none; }
  .cta:hover { transform: none; }
}
