:root {
  --brown: #3f2619;
  --brown-2: #5a3623;
  --gold: #b38a45;
  --cream: #fff7ea;
  --text: #2b211c;
  --muted: #766558;
  --shadow: 0 22px 60px rgba(63, 38, 25, 0.16);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--text);
}


.back-home {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(63, 38, 25, 0.88);
  color: #fff7ea;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(63, 38, 25, 0.28);
  border: 1px solid rgba(255, 247, 234, 0.24);
  backdrop-filter: blur(10px);
  transition: transform .18s ease, background .18s ease;
}

.back-home:hover,
.back-home:focus-visible {
  transform: translateY(-1px);
  background: rgba(63, 38, 25, 0.98);
}

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

.hero {
  min-height: 86vh;
  display: grid;
  place-items: center;
  padding: 50px 20px;
  background:
    radial-gradient(circle at top left, rgba(179, 138, 69, 0.24), transparent 35%),
    linear-gradient(135deg, #fff8ee 0%, #f3dfc4 100%);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% -10%;
  height: 260px;
  background: repeating-linear-gradient(45deg, rgba(156,45,34,.08) 0 10px, transparent 10px 20px);
  transform: rotate(-2deg);
}

.hero-inner {
  width: min(1050px, 100%);
  position: relative;
  z-index: 1;
  text-align: center;
}

.logo {
  width: min(560px, 92vw);
  margin: 0 auto 35px;
  filter: drop-shadow(0 14px 24px rgba(63, 38, 25, 0.12));
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .8rem;
  font-weight: 900;
}

h1, h2, h3 { color: var(--brown); line-height: 1.05; }

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  letter-spacing: -0.05em;
}

.lead {
  width: min(760px, 100%);
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn, button { font: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn:hover, .open-comic:hover { transform: translateY(-2px); }

.primary {
  background: var(--brown);
  color: white;
  box-shadow: 0 14px 30px rgba(63, 38, 25, .25);
}


.bd-section { padding: 80px 20px; }

.section-heading {
  width: min(760px, 100%);
  margin: 0 auto;
  text-align: center;
}

.section-heading h2, .info-section h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.04em;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.bd-grid {
  width: min(1120px, 100%);
  margin: 42px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.bd-card {
  background: white;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(63, 38, 25, .08);
  transition: transform .24s ease, box-shadow .24s ease;
}

.bd-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 80px rgba(63, 38, 25, 0.22);
}

.bd-card img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.bd-card-content { padding: 24px; text-align: left; }

.tag {
  display: inline-flex;
  background: #f6ead6;
  color: var(--brown-2);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.bd-card h3 { margin: 16px 0 9px; font-size: 1.55rem; }

.bd-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.open-comic {
  margin-top: 20px;
  border: none;
  background: var(--brown);
  color: white;
  padding: 13px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(63, 38, 25, .2);
  transition: transform .2s ease, box-shadow .2s ease;
}







.comic-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(19, 11, 7, .92);
  overflow-y: auto;
  padding: 28px;
}

.comic-modal.active {
  display: grid;
  place-items: start center;
}

.comic-frame {
  width: min(1000px, 100%);
  padding: 0;
  margin: 12px auto 40px;
}

.comic-frame img {
  width: 100%;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
  background: white;
}

.close-modal, .nav-btn {
  border: none;
  cursor: pointer;
  background: white;
  color: var(--brown);
  box-shadow: 0 14px 30px rgba(0,0,0,.24);
}

.close-modal {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
  z-index: 3;
}

.nav-btn {
  position: fixed;
  top: 50%;
  width: 54px;
  height: 72px;
  border-radius: 18px;
  font-size: 3rem;
  line-height: 1;
  z-index: 3;
  transform: translateY(-50%);
}

.nav-btn.prev { left: 18px; }
.nav-btn.next { right: 18px; }


@media (max-width: 980px) {
  .bd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: 42px 18px 56px;
  }

  .logo { margin-bottom: 26px; }

  .bd-grid { grid-template-columns: 1fr; }

  .bd-section { padding: 58px 16px; }

  .bd-card-content { padding: 20px; }

  .comic-modal {
    padding: 12px;
    display: none;
    place-items: start center;
  }

  .comic-modal.active { display: block; }

  .comic-frame {
    width: 100%;
    margin-top: 64px;
    margin-bottom: 28px;
  }

  .comic-frame img { border-radius: 14px; }

  .close-modal {
    width: 46px;
    height: 46px;
    top: 12px;
    right: 12px;
  }

  .nav-btn {
    top: 24px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    font-size: 2rem;
    transform: none;
  }

  .nav-btn.prev { left: 12px; }
  .nav-btn.next { left: 62px; right: auto; }
}


/* Atualização v9 — mobile sem cortes:
   em telemóvel a banda desenhada é mostrada inteira,
   sem recortes por quadradinhos. */
@media (max-width: 768px) {
  .comic-modal {
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .comic-frame {
    width: 100%;
    max-width: 100%;
    margin-top: 74px;
    margin-bottom: 28px;
  }

  .comic-frame img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
  }
}


/* Atualização v10 — mobile em painéis verticais legíveis.
   Usa imagens mobile já preparadas, sem zoom pequeno e sem recortes duplicados. */
@media (max-width: 768px) {
  .comic-modal {
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .comic-frame {
    width: 100%;
    max-width: 100%;
    margin-top: 72px;
    margin-bottom: 24px;
  }

  .comic-frame img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }
}
