@import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;600&family=Spectral:ital,wght@0,400;0,600;1,400&display=swap");

/* ---------- Paleta (a do ecrã-título) ---------- */
:root {
  --night-0: #07061a;
  --night-1: #0b0a24;
  --night-2: #16123a;
  --dusk:    #2c2161;
  --violet:  #4a3a8c;
  --ember:   #f0782a;
  --ember-2: #ff9d47;
  --gold:    #f5c95a;
  --gold-2:  #ffe39a;
  --cream:   #fbecc6;
  --ink:     #e9e4f7;
  --muted:   #a9a2c9;
  --snake:   #7da04a;
  --panel:   rgba(22, 18, 58, .78);
  --line:    #5b4ba3;
  --radius:  4px;
  --pixel:   "Pixelify Sans", "Courier New", monospace;
  --serif:   "Spectral", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--night-1);
  color: var(--ink);
  font: 1.125rem/1.65 var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
.px, .hero-bg, .hero-title, .portrait, .sprite, .quote-portrait, .shot img, .studio-logo, .brand img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-2); }
:focus-visible { outline: 2px dashed var(--gold); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--pixel); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); color: var(--cream); text-shadow: 0 2px 0 #000; }
h3 { font-size: 1.2rem; color: var(--gold); }
p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: #000; padding: 8px 12px; }
.skip:focus { left: 8px; }

.kicker {
  font-family: var(--pixel);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .85rem;
  color: var(--ember-2);
  margin-bottom: .6em;
}
.kicker::before { content: "◆ "; color: var(--gold); }

/* ---------- Botões ---------- */
.btn {
  display: inline-block;
  font: 600 1rem/1 var(--pixel);
  letter-spacing: .04em;
  text-decoration: none;
  padding: 14px 22px;
  border: 2px solid #000;
  border-radius: var(--radius);
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.35), inset 3px 3px 0 rgba(255,255,255,.25), 0 4px 0 #000;
  transition: transform .1s, box-shadow .1s, filter .15s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: inset -3px -3px 0 rgba(0,0,0,.35), inset 3px 3px 0 rgba(255,255,255,.25), 0 1px 0 #000; }
.btn-gold { background: linear-gradient(var(--gold-2), var(--gold) 55%, #d99a2b); color: #2a1606; }
.btn-gold:hover { color: #2a1606; }
.btn-ghost { background: rgba(11,10,36,.6); color: var(--cream); border-color: var(--gold); box-shadow: 0 4px 0 #000; }
.btn-ghost:hover { color: var(--gold-2); }

/* ---------- Barra de topo ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  background: linear-gradient(rgba(7,6,26,.92), rgba(7,6,26,.7));
  backdrop-filter: blur(6px);
  border-bottom: 2px solid rgba(91,75,163,.5);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); font: 600 1.1rem var(--pixel); }
.brand img { width: 40px; height: 40px; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: block; padding: 8px 10px; color: var(--ink); text-decoration: none; font: 400 .98rem var(--pixel); }
.nav-links a:hover { color: var(--gold); }
.langs { display: flex; margin-left: 8px; border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.langs a { padding: 6px 9px; font-size: .85rem; color: var(--muted); }
.langs a[aria-current] { background: var(--gold); color: #2a1606; }
.nav-toggle { display: none; background: none; border: 2px solid var(--line); border-radius: var(--radius); width: 44px; height: 40px; cursor: pointer; }
.bars, .bars::before, .bars::after { display: block; width: 20px; height: 3px; background: var(--cream); margin: auto; position: relative; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -7px; } .bars::after { top: 7px; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--night-0); border-bottom: 2px solid var(--line);
    padding: 8px 16px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; font-size: 1.1rem; }
  .langs { margin: 8px 0 0; align-self: flex-start; }
  .langs a { padding: 8px 14px; }
}

/* ---------- Herói ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--night-0);
}
.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 100%;
  z-index: -3;
}
.hero-stars { image-rendering: pixelated; position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.hero-moon {
  position: absolute; z-index: -2;
  top: clamp(80px, 13vh, 140px); right: clamp(24px, 9vw, 160px);
  width: clamp(36px, 4.5vw, 64px); aspect-ratio: 1;
  background:
    radial-gradient(circle at 35% 40%, #fff9e0 0 18%, transparent 19%),
    radial-gradient(circle at 62% 62%, #e9dca8 0 10%, transparent 11%),
    #f6edc4;
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(246,237,196,.08), 0 0 0 26px rgba(246,237,196,.05), 0 0 80px 30px rgba(246,237,196,.18);
}
.hero-glow { /* o brilho da Cova da Moura, na encosta */
  position: absolute; z-index: -2;
  left: 55.5%; bottom: 26%;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 18px 8px rgba(255,214,120,.55), 0 0 60px 26px rgba(255,180,80,.25);
  animation: glow 4s ease-in-out infinite;
}
@keyframes glow { 0%,100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.15); } }
.hero::after { /* escurece para o texto se ler sobre o céu e funde com a secção seguinte */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(7,6,26,.45), transparent 60%),
    linear-gradient(transparent 70%, var(--night-1));
}
.hero-content { padding: 110px 0 120px; }
.badge {
  display: inline-block; font: 400 .85rem var(--pixel); letter-spacing: .14em; text-transform: uppercase;
  color: var(--cream); background: rgba(7,6,26,.6); border: 2px solid var(--ember);
  padding: 6px 12px; border-radius: var(--radius); margin-bottom: 18px;
}
.hero h1 { margin: 0; }
.hero-title { width: min(740px, 92vw); filter: drop-shadow(0 6px 0 rgba(0,0,0,.45)); animation: float 7s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero-tag { font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--cream); max-width: 38ch; margin: 14px auto 28px; text-shadow: 0 2px 6px #000, 0 0 2px #000; font-style: italic; }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.scroll-hint { position: absolute; bottom: 22px; left: 50%; translate: -50% 0; width: 28px; height: 44px; border: 2px solid var(--cream); border-radius: 14px; opacity: .7; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; translate: -50% 0; background: var(--cream); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 0; top: 6px; } 30% { opacity: 1; } 100% { opacity: 0; top: 22px; } }

/* ---------- Secções ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.section-head { max-width: 720px; margin-bottom: 40px; }
.chapters-head { margin-top: 96px; }

/* moldura de caixa de diálogo JRPG */
.dialog, .panel, .card, .quote {
  background: var(--panel);
  border: 3px solid var(--cream);
  border-radius: 6px;
  box-shadow: 0 0 0 3px #000, inset 0 0 0 3px var(--dusk), 0 10px 0 rgba(0,0,0,.35);
}

.story { background: linear-gradient(var(--night-1), var(--night-2)); }
.story-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.story p { color: var(--ink); max-width: 62ch; }
.story strong { color: var(--gold-2); font-weight: 600; }
.quote { margin: 0; padding: 36px 30px 28px; text-align: center; }
.quote-portrait { width: 128px; height: 128px; border: 3px solid var(--gold); background: var(--night-0); margin-bottom: 18px; }
.quote blockquote { margin: 0; }
.quote blockquote p { font: 600 clamp(1.6rem, 3vw, 2.1rem)/1.2 var(--pixel); color: var(--cream); margin: 0 0 .4em; }
.quote figcaption { color: var(--muted); font-style: italic; }
.quote figcaption::before { content: "— "; }

.features { background: var(--night-2); }
.feature-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.panel { padding: 26px 24px 18px; }
.panel p { color: var(--muted); font-size: 1.02rem; }
.px-icon { width: 48px; height: 48px; display: block; margin-bottom: 14px; }
.px-icon.small { width: 20px; height: 20px; display: inline-block; vertical-align: -3px; margin: 0; }
.px-a { fill: #1a1033; }
.px-b { fill: var(--gold); }
.px-icon .px-a { fill: var(--gold); }
.px-icon .px-b { fill: var(--ember); }

.chapters { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 18px; counter-reset: c; }
.chapter { display: flex; gap: 18px; align-items: flex-start; padding: 18px 0; border-top: 2px dashed var(--line); }
.chapter-n {
  flex: none; width: 52px; height: 52px; display: grid; place-items: center;
  font: 600 1.5rem var(--pixel); color: #2a1606;
  background: linear-gradient(var(--gold-2), var(--gold) 55%, #d99a2b);
  border: 2px solid #000; box-shadow: 0 4px 0 #000;
  clip-path: polygon(0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px));
}
.chapter h3 { margin-bottom: .2em; }
.chapter-era { color: var(--cream); margin: 0; font-size: 1rem; }
.chapter-tone { color: var(--muted); margin: 0; font-size: .95rem; font-style: italic; }

.cast { background: linear-gradient(var(--night-2), var(--night-1)); }
.cast-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 22px; }
.card { padding: 18px 18px 8px; transition: transform .2s; }
.card:hover { transform: translateY(-4px); }
.card-art {
  position: relative; height: 150px; margin: -4px -4px 14px; border-radius: 3px;
  background: radial-gradient(ellipse at 50% 110%, var(--violet), var(--night-0) 70%);
  display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding-bottom: 10px; overflow: hidden;
}
.card .portrait { width: 128px; height: 128px; border: 3px solid var(--gold); background: var(--night-0); }
.card .sprite { width: 96px; height: 96px; margin-left: -6px; transition: transform .3s; }
.card:hover .sprite { transform: translateY(-4px); }
.card h3 { font-size: 1.1rem; }
.card p { color: var(--muted); font-size: 1rem; }

.shots { background: var(--night-1); }
.shot-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; border: 3px solid var(--cream); box-shadow: 0 0 0 3px #000, 0 10px 0 rgba(0,0,0,.35); border-radius: 4px; }
.shot figcaption { color: var(--muted); font-size: .98rem; font-style: italic; margin-top: 12px; }

.status { background: linear-gradient(var(--night-1), var(--night-2)); }
.status-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.dialog { padding: 26px 28px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; font-size: 1.05rem; border-bottom: 1px dashed rgba(91,75,163,.6); }
.checklist li:last-child { border: 0; }
.checklist .done .px-a { fill: var(--snake); }
.checklist .todo { color: var(--muted); }
.checklist .todo .px-a { fill: var(--ember); }
.checklist .todo .px-b { fill: var(--night-0); }

.studio { background: var(--night-2); }
.studio-grid { display: grid; grid-template-columns: minmax(200px, 360px) 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.studio-logo { width: 100%; filter: drop-shadow(0 10px 0 rgba(0,0,0,.35)); }
.place { font-family: var(--pixel); color: var(--cream); }
.place .px-a { fill: var(--gold); } .place .px-b { fill: var(--ember); }

.contact { background: linear-gradient(var(--night-2), var(--night-0)); text-align: center; }
.contact-box { max-width: 760px; padding: clamp(32px, 6vw, 56px); }
.contact-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 24px 0 0; }

.footer { background: var(--night-0); border-top: 2px solid rgba(91,75,163,.5); padding: 32px 0; font-size: .92rem; color: var(--muted); }
.footer-grid { display: grid; gap: 6px; }
.footer p { margin: 0; }
.credits { font-size: .85rem; }

@media (max-width: 860px) {
  .story-grid, .status-grid, .studio-grid, .shot-grid { grid-template-columns: 1fr; }
  .studio-logo { max-width: 260px; margin: auto; }
  .hero-glow { display: none; }
}

/* ---------- Revelar ao fazer scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
