:root {
  --ink: #17130f;
  --paper: #f8f3e8;
  --paper-2: #efe5d2;
  --wine: #632534;
  --wine-dark: #32141d;
  --gold: #b78b3c;
  --gold-soft: #dcc59a;
  --muted: #71675d;
  --line: rgba(50, 20, 29, 0.15);
  --white: #fffdf8;
  --shadow: 0 24px 60px rgba(50, 20, 29, 0.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 243, 232, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.nav {
  width: min(1180px, calc(100% - 40px));
  min-height: 96px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  line-height: 1.1;
}
.brand-mark {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(50, 20, 29, .16));
}
.brand-copy { display: block; min-width: 0; }
.brand strong {
  display: block;
  color: var(--wine-dark);
  font-family: Georgia, serif;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
}
.brand-copy > span { display: block; margin-top: 5px; color: var(--muted); font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { text-decoration: none; font-size: 0.93rem; font-weight: 650; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--wine); }
.menu-toggle { display: none; border: 0; background: transparent; font-size: 1.5rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--wine);
  color: white;
  text-decoration: none;
  font-weight: 750;
  box-shadow: 0 10px 26px rgba(99, 37, 52, 0.2);
}
.button.secondary { background: transparent; color: var(--wine); border: 1px solid currentColor; box-shadow: none; }

.hero {
  position: relative;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 78% 18%, rgba(183,139,60,.24), transparent 28%),
    radial-gradient(circle at 18% 80%, rgba(159,68,90,.24), transparent 30%),
    linear-gradient(135deg, #271018, #4e1f2a 62%, #221015);
}
.hero::after,
.page-hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: min(650px, 58vw);
  aspect-ratio: 1;
  right: -7vw;
  top: 50%;
  transform: translateY(-50%);
  background: url("assets/logo-pai-marcelo-v1.png") center / contain no-repeat;
  opacity: .055;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  min-height: 650px;
  margin: auto;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  align-items: center;
  gap: 72px;
  padding: 90px 0;
}
.eyebrow {
  margin: 0 0 16px;
  color: var(--gold-soft);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .19em;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: Georgia, serif; line-height: 1.12; color: var(--wine-dark); }
h1 { margin: 0 0 22px; font-size: clamp(2.7rem, 6vw, 5.8rem); letter-spacing: -.035em; }
.hero h1 { color: white; }
.hero .lead { max-width: 690px; font-size: clamp(1.08rem, 2vw, 1.35rem); color: rgba(255,255,255,.82); }
.hero-actions { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 32px; }
.hero .button { background: var(--gold); color: #21160b; }
.hero .button.secondary { color: white; border-color: rgba(255,255,255,.45); background: transparent; }
.portrait-frame {
  position: relative;
  min-height: 500px;
  aspect-ratio: 3 / 4;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(220,197,154,.38);
  border-radius: 180px 180px 24px 24px;
  background: rgba(255,255,255,.06);
  box-shadow: 0 28px 75px rgba(11,4,7,.36), inset 0 0 0 8px rgba(255,255,255,.025);
}
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28,12,17,.78), transparent 35%);
  pointer-events: none;
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
}
.portrait-frame figcaption {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 24px;
  color: white;
  text-align: center;
  font: 700 1.08rem Georgia, serif;
  letter-spacing: .04em;
}

.section { padding: 92px 0; }
.section.alt { background: var(--white); }
.container { width: min(1080px, calc(100% - 40px)); margin: auto; }
.narrow { width: min(790px, calc(100% - 40px)); margin: auto; }
.section h2 { margin: 0 0 18px; font-size: clamp(2rem, 4vw, 3.35rem); }
.section-lead { max-width: 730px; color: var(--muted); font-size: 1.08rem; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 42px; }
.card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 12px 35px rgba(50,20,29,.055);
}
.card h3 { margin: 0 0 12px; font-size: 1.35rem; }
.card p { margin: 0; color: var(--muted); }
.card a { display: inline-block; margin-top: 18px; color: var(--wine); font-weight: 750; }
.number { color: var(--gold); font: 700 1rem Georgia, serif; }
.section-action { margin-top: 32px; }
.home-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 42px; }
.home-gallery figure { position: relative; min-height: 390px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--paper-2); box-shadow: 0 16px 38px rgba(50,20,29,.11); }
.home-gallery img { width: 100%; height: 100%; object-fit: cover; }
.home-gallery figure::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(to top, rgba(28,12,17,.9), transparent); pointer-events: none; }
.home-gallery figcaption { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 17px; color: white; font: 700 1.05rem Georgia, serif; line-height: 1.3; }

.page-hero { position: relative; overflow: hidden; padding: 95px 0 75px; background: linear-gradient(145deg, #f1e6d4, #fffaf0); border-bottom: 1px solid var(--line); }
.page-hero .container { position: relative; z-index: 1; }
.page-hero::after { width: min(470px, 52vw); right: 1vw; opacity: .06; }
.page-hero h1 { max-width: 900px; font-size: clamp(2.6rem, 6vw, 5rem); }
.page-hero .lead { max-width: 780px; color: var(--muted); font-size: 1.22rem; }
.article { padding: 70px 0 105px; }
.article h2 { margin-top: 54px; font-size: clamp(1.65rem, 3vw, 2.35rem); }
.article h2:first-child { margin-top: 0; }
.article p, .article li { font-size: 1.05rem; }
.article p { margin: 0 0 20px; }
.article ul { padding-left: 1.2rem; }
.note { margin: 38px 0; padding: 24px 26px; border-left: 4px solid var(--gold); background: var(--paper-2); }

.timeline { margin: 44px 0; border-left: 2px solid var(--gold-soft); }
.timeline-item { position: relative; padding: 0 0 34px 32px; }
.timeline-item::before { content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--wine); }
.timeline-item strong { color: var(--wine); }
.historical-section { margin: 58px 0 72px; }
.historical-section > .eyebrow { margin-bottom: 8px; }
.historical-section > h2 { margin-top: 0; }
.archive-gallery { columns: 2 280px; column-gap: 18px; margin-top: 34px; }
.archive-gallery figure { display: inline-block; width: 100%; margin: 0 0 18px; overflow: hidden; break-inside: avoid; border: 1px solid var(--line); border-radius: 18px; background: var(--paper-2); box-shadow: 0 16px 38px rgba(50,20,29,.11); }
.archive-gallery img { display: block; width: 100%; height: auto; }
.archive-gallery figcaption { padding: 13px 16px 15px; color: var(--wine-dark); font-weight: 700; line-height: 1.4; }
.china-section { margin: 64px 0 72px; }
.china-section > .eyebrow { margin-bottom: 8px; }
.china-section > h2 { margin-top: 0; }
.china-gallery figure:first-child { border-color: var(--gold-soft); box-shadow: 0 20px 48px rgba(50,20,29,.16); }
.historical-photo { max-width: 660px; margin: 38px auto 44px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--paper-2); box-shadow: 0 22px 55px rgba(50,20,29,.14); }
.historical-photo img { display: block; width: 100%; height: auto; }
.historical-photo figcaption { padding: 15px 20px 17px; color: var(--wine-dark); font: 700 1.05rem Georgia, serif; text-align: center; }
.gallery-placeholder { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 36px; }
.photo-slot { min-height: 230px; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); border: 1px dashed rgba(99,37,52,.3); border-radius: 18px; background: linear-gradient(145deg, #f0e3ce, #fffaf1); }

.cta { padding: 65px 0; color: white; background: var(--wine-dark); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 35px; }
.cta h2 { margin: 0 0 10px; color: white; }
.cta p { margin: 0; color: rgba(255,255,255,.72); }
.cta .button { background: var(--gold); color: #21160b; flex: 0 0 auto; }
.site-footer { padding: 45px 0; background: #1c0c11; color: rgba(255,255,255,.68); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.whatsapp-float {
  position: fixed;
  z-index: 50;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 0 18px 0 14px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 999px;
  color: white;
  background: #168c4b;
  box-shadow: 0 12px 30px rgba(11,58,32,.34);
  text-decoration: none;
  font-weight: 800;
  transition: transform .2s ease, background-color .2s ease;
}
.whatsapp-float:hover, .whatsapp-float:focus-visible { background: #107b40; transform: translateY(-3px); }
.whatsapp-float svg { width: 31px; height: 31px; flex: 0 0 auto; }

@media (max-width: 1020px) {
  .menu-toggle { display: block; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 96px; padding: 22px 20px 28px; flex-direction: column; align-items: flex-start; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 18px 35px rgba(50,20,29,.1); }
  .nav-links.open { display: flex; }
  .hero-inner { grid-template-columns: 1fr; min-height: auto; padding: 70px 0; }
  .portrait-frame { width: min(420px, 100%); min-height: 0; margin: 0 auto; border-radius: 150px 150px 20px 20px; }
  .grid, .gallery-placeholder, .home-gallery { grid-template-columns: 1fr; }
  .home-gallery figure { min-height: 460px; }
  .cta-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .nav, .container, .narrow, .hero-inner { width: min(100% - 28px, 1080px); }
  .section { padding: 68px 0; }
  .hero-inner { gap: 46px; padding: 48px 0 64px; }
  .hero h1 { font-size: clamp(3rem, 13vw, 4.2rem); }
  .hero-actions .button { width: 100%; }
  .nav { min-height: 82px; }
  .brand { gap: 9px; }
  .brand-mark { width: 60px; height: 60px; flex-basis: 60px; }
  .brand strong { font-size: 1.05rem; }
  .brand-copy > span { margin-top: 3px; font-size: .57rem; letter-spacing: .07em; }
  .nav-links { top: 82px; }
  .hero::after, .page-hero::after { width: 90vw; right: -30vw; opacity: .045; }
  .home-gallery figure { min-height: 380px; }
  .whatsapp-float { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); min-height: 56px; padding: 0 15px 0 12px; gap: 7px; font-size: .84rem; }
  .whatsapp-float svg { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-float { transition: none; }
}
