
/* =========================================================
   TOKENS — identidade visual da Imersão Ruptura
   ========================================================= */
:root {
  --ground: #F7ECD9;          /* fundo geral (creme) */
  --parchment: #F6E2C4;       /* faixa do topo (pergaminho) */
  --parchment-edge: #F2D8B2;  /* borda do degradê do topo */
  --light: #FCF5E8;           /* centro da luz do topo */
  --tile: #EFDDBF;            /* fundo de miniatura/placeholder */
  --tile-2: #EBD6B4;          /* listra do placeholder */
  --ink: #452B12;             /* texto principal (marrom) */
  --muted: #75583A;           /* texto secundário (5.5:1 no creme) */
  --line: #B99A70;            /* contornos de botões/pílulas */
  --gold: #A67004;            /* dourado: linhas, estrelas, seleção */
  --gold-text: #8A5A00;       /* dourado para texto pequeno (4.6:1+) */
  --gold-light: #E3AA45;      /* dourado claro: botões sobre fundo escuro */
  --flare: #E9A23B;           /* estrela de luz */
  --dark: #2A1A0B;            /* barra de seleção */
  --overlay: rgba(33, 21, 9, 0.97); /* fundo da foto aberta */
  --on-dark-muted: #CDB596;

  --serif: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --sans: 'Lexend', 'Helvetica Neue', system-ui, sans-serif;

  --pad: clamp(16px, 4.5vw, 64px);
  --maxw: 1440px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body.has-selection { padding-bottom: 104px; }
body.lb-open { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse 75% 55% at 50% 22%, var(--light) 0%, var(--parchment) 60%, var(--parchment-edge) 100%);
}
.hero-head {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 20px; padding-top: clamp(40px, 5vw, 80px);
}
.hero-logo { margin: 0; width: min(100%, 640px); }
.hero-logo img { width: 100%; height: auto; }
.eyebrow {
  margin: 0; display: flex; align-items: center; gap: 14px;
  font-family: var(--serif); font-weight: 700; font-size: 13px;
  letter-spacing: 0.42em; text-transform: uppercase; color: var(--gold-text);
}
.eyebrow span { margin-right: -0.42em; }
.star { color: var(--gold); flex: none; }
.intro {
  margin: 0; max-width: 640px;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(20px, 2.1vw, 30px); line-height: 1.35; text-wrap: balance;
}
.meta {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.meta .diamond { width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn-primary { background: var(--ink); color: var(--ground); border: 1px solid var(--ink); }
.btn-primary:hover { background: #2F1D0B; }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }

/* arco dourado + foto de abertura (eco do círculo da arte do evento) */
.hero-figure {
  position: relative; display: flex; justify-content: center;
  margin-top: clamp(32px, 4.5vw, 64px); padding-top: max(14vw, 80px);
}
.halo {
  position: absolute; top: 0; left: 50%;
  width: max(92vw, 520px); aspect-ratio: 1 / 1; transform: translateX(-50%);
  pointer-events: none;
}
.halo-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--gold); opacity: .55; }
.halo-flare {
  position: absolute; left: 99.5%; top: 57%; width: 140px; height: 140px; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(255,222,160,.85) 0%, rgba(240,166,60,.28) 28%, rgba(240,166,60,0) 62%);
}
.halo-flare::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 260px; height: 1px; transform: translate(-50%, -50%);
  background: linear-gradient(90deg, rgba(233,162,59,0), rgba(233,162,59,.85), rgba(233,162,59,0));
}
.halo-flare svg { position: relative; color: var(--flare); }
.hero-photo {
  position: relative; z-index: 1;
  width: min(100%, max(62vw, 340px)); aspect-ratio: 3 / 2;
  overflow: hidden; border-radius: var(--radius); background: var(--tile);
  box-shadow: 0 28px 60px rgba(69, 43, 18, .18);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.hero-spacer { height: clamp(40px, 5vw, 72px); }

/* linha de luz (eco do traço sob o logo) */
.light-rule {
  position: relative; height: 1px; opacity: .6;
  background: linear-gradient(90deg, rgba(166,112,4,0), var(--gold) 30%, var(--gold) 70%, rgba(166,112,4,0));
}
.light-rule::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 220px; height: 26px; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(240,166,60,.55) 0%, rgba(240,166,60,0) 70%);
}

/* placeholder (some quando houver foto real) */
.ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; text-align: center;
  background: repeating-linear-gradient(135deg, var(--tile) 0 12px, var(--tile-2) 12px 24px);
  font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.ph em { font-family: var(--serif); font-size: 15px; letter-spacing: 0; text-transform: none; }

/* ---------- GALERIA ---------- */
.gallery {
  padding-top: clamp(64px, 7.8vw, 112px);
  display: flex; flex-direction: column; gap: clamp(24px, 2.8vw, 40px);
}
.gallery-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.gallery-head h2 {
  margin: 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(36px, 4.4vw, 60px); line-height: 1.05; letter-spacing: -0.005em;
}
.gallery-head p { margin: 0; max-width: 460px; font-size: 15px; font-weight: 300; line-height: 1.55; color: var(--muted); text-wrap: balance; }
.filters-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.periods-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.periods { width: 100%; max-width: 1000px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.filter-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-text); }
.filters { width: 100%; max-width: 1000px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 400; cursor: pointer; transition: background-color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ink); }
.chip .count { font-size: 12px; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ground); font-weight: 500; }
.chip[aria-pressed="true"] .count { color: #E3C9A0; }
.showing { font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 20vw, 300px), 1fr));
  gap: clamp(14px, 2vw, 28px) clamp(8px, 1.1vw, 16px);
}
.tile { margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tile-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--tile); }
.tile-open {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;
  background: transparent; cursor: zoom-in; display: block;
}
.tile-open img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; transition: transform .5s ease; }
.tile-open:hover img { transform: scale(1.03); }
.tile-media.is-selected::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius); border: 3px solid var(--gold); pointer-events: none;
}
.tile-pick {
  position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; margin: 0; padding: 0; border: 0;
  background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.tile-pick .dot {
  width: 26px; height: 26px; border-radius: 999px; border: 2px solid #fff;
  background: rgba(42,26,11,.3); box-shadow: 0 1px 6px rgba(42,26,11,.4);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.tile-pick .dot svg { display: none; }
.tile-pick[aria-pressed="true"] .dot { width: 28px; height: 28px; border: 0; background: var(--gold); box-shadow: 0 2px 8px rgba(42,26,11,.35); }
.tile-pick[aria-pressed="true"] .dot svg { display: block; }
.tile figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tile .num { font-family: var(--serif); font-style: italic; font-size: 16px; }
.tile .cat { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.load-controls { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#load-sentinel { width: 1px; height: 1px; }
.loading-state { grid-column: 1 / -1; text-align: center; color: var(--muted); }

/* ---------- RODAPÉ ---------- */
.footer {
  margin-top: clamp(80px, 8.9vw, 128px); padding-bottom: clamp(48px, 6vw, 88px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(24px, 2.5vw, 36px);
}
.footer .light-rule { align-self: stretch; }
.tag-line {
  margin: 0; display: flex; flex-direction: column; gap: 4px;
  font-family: var(--serif); font-size: clamp(34px, 4.6vw, 64px); line-height: 1.08; text-wrap: balance;
}
.tag-line .q { font-style: italic; font-weight: 400; }
.tag-line .a { font-weight: 500; }
.tag-line .handle { color: var(--gold-text); }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 28px; font-size: 15px; }
.footer-links .credit { color: var(--muted); }
.footer-links a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px;
}
.footer-logo { width: 150px; height: auto; margin-top: 8px; }

/* ---------- BARRA DE SELEÇÃO ---------- */
.selbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.selbar[hidden], body.lb-open .selbar { display: none; }
.selbar-inner {
  pointer-events: auto; width: min(100%, 720px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 10px 10px 10px 22px; border-radius: 28px; background: var(--dark); color: var(--ground);
  box-shadow: 0 18px 50px rgba(42,26,11,.35);
}
.selbar-label { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; }
.selbar-label svg { color: var(--gold-light); }
.selbar-actions { display: flex; align-items: center; gap: 4px; }
.link-btn {
  min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--ground);
  font-size: 15px; text-decoration: underline; text-decoration-color: rgba(247,236,217,.5); text-underline-offset: 4px; cursor: pointer;
}
.btn-gold {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--gold-light); color: var(--dark); font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-gold:hover { background: #ECB759; }
.btn-gold:disabled { opacity: .65; cursor: wait; }

/* ---------- FOTO ABERTA (lightbox) ---------- */
.lb { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--overlay); color: var(--ground); }
.lb[hidden] { display: none; }
.lb-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 12px clamp(12px, 2vw, 24px); border-bottom: 1px solid rgba(247,236,217,.12);
}
.lb-id { display: flex; align-items: baseline; gap: 14px; }
.lb-num { font-family: var(--serif); font-style: italic; font-size: 20px; }
.lb-cat { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-muted); }
.lb-tools { display: flex; align-items: center; gap: 8px; }
.lb-pick {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(247,236,217,.3); background: transparent; color: var(--ground); font-size: 15px; cursor: pointer;
}
.lb-pick .dot { width: 18px; height: 18px; border-radius: 999px; border: 2px solid var(--ground); display: flex; align-items: center; justify-content: center; color: var(--dark); }
.lb-pick .dot svg { display: none; }
.lb-pick[aria-pressed="true"] { border-color: var(--gold-light); }
.lb-pick[aria-pressed="true"] .dot { width: 20px; height: 20px; border: 0; background: var(--gold-light); }
.lb-pick[aria-pressed="true"] .dot svg { display: block; }
.icon-btn {
  width: 44px; height: 44px; margin: 0; padding: 0; border-radius: 999px;
  border: 1px solid rgba(247,236,217,.3); background: transparent; color: var(--ground);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lb-stage {
  flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center;
  padding: 16px clamp(8px, 6vw, 96px);
}
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-zoom-viewport { width: 100%; height: 100%; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; user-select: none; cursor: zoom-in; }
.lb-zoom-viewport.is-zoomed { cursor: grab; }
.lb-zoom-viewport.is-zoomed:active { cursor: grabbing; }
.lb-zoom-viewport img { width: auto; height: auto; max-width: 100%; max-height: 100%; transform-origin: center center; user-select: none; }
.lb-ph {
  height: 100%; max-height: 680px; aspect-ratio: 3 / 2; max-width: 100%; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); background: repeating-linear-gradient(135deg, #3A2914 0 14px, #36260F 14px 28px);
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--on-dark-muted);
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; margin: 0; padding: 0;
  border-radius: 999px; border: 1px solid rgba(247,236,217,.3); background: rgba(42,26,11,.7); color: var(--ground);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lb-prev { left: clamp(8px, 1.5vw, 24px); }
.lb-next { right: clamp(8px, 1.5vw, 24px); }
.lb-pos {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--on-dark-muted);
}
.lb-hint { font-family: var(--sans); font-style: normal; font-size: 11px; color: var(--on-dark-muted); }

@media (max-width: 640px) {
  .halo-flare { display: none; } /* no celular o ponto de luz cai fora da tela */
  .periods .chip { padding-inline: 10px; }
  .lb-stage { padding-inline: 5px; }
  .lb-nav { width: 42px; height: 42px; }
  .lb-tools { gap: 5px; }
  .lb-pick { padding-inline: 10px; font-size: 13px; }
  #lb-download { padding-inline: 12px !important; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
