/* ───────────────────────────────────────────────────────────────────
   Portfólio cinematográfico — Emyle Lucena
   Inspirado em justinrands.com: vídeo emoldurado em branco, dock de
   vidro flutuante com lista + modal de detalhe, metadados em mono.
   ─────────────────────────────────────────────────────────────────── */

:root {
  --paper: #ffffff;
  --ink: #0f0f10;
  --ink-dim: #8a8a8f;
  --glass-text: #ffffff;
  --glass-dim: rgba(255, 255, 255, 0.62);
  --glass-bg: rgba(38, 38, 42, 0.34);
  --glass-line: rgba(255, 255, 255, 0.16);
  --radius-frame: clamp(16px, 2.4vw, 28px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pin: #18181b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(8px, 1.4vw, 16px);
  padding-bottom: 0;
}

/* ── Moldura do vídeo ─────────────────────────────────────────────── */
.frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: var(--radius-frame);
  overflow: hidden;
  background: #000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Vídeo de fundo: máxima fidelidade, sem overlay sobre a imagem */
.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ── Botão de som (canto superior direito) ────────────────────────── */
.sound-toggle {
  position: absolute;
  top: clamp(12px, 2.4vh, 22px);
  right: clamp(12px, 2vw, 22px);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--glass-text);
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-line);
  cursor: pointer;
  z-index: 6;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.sound-toggle:hover { transform: scale(1.06); background: rgba(38, 38, 42, 0.5); }
.sound-toggle:active { transform: scale(0.95); }
.sound-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.sound-toggle .icon { width: 19px; height: 19px; }
.sound-toggle .icon-off { display: none; }
.sound-toggle.is-muted .icon-on { display: none; }
.sound-toggle.is-muted .icon-off { display: block; }
.sound-toggle.is-muted { animation: pulse 2.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08); }
}

/* ── Dock + painel (base, centro) ─────────────────────────────────── */
.dock-wrap {
  position: absolute;
  bottom: clamp(16px, 3vh, 26px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
}

/* Painel translúcido que cresce para cima */
.panel {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  width: min(380px, 86vw);            /* lista compacta */
  max-height: min(66vh, 560px);
  overflow-y: auto;
  padding: 8px;
  border-radius: 26px;
  background: var(--glass-bg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translate(-50%, 12px) scale(0.97);
  transform-origin: bottom center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.4s var(--ease),
    width 0.45s var(--ease), max-height 0.45s var(--ease),
    bottom 0.45s var(--ease), padding 0.4s var(--ease);
  scrollbar-width: none;
}
.panel::-webkit-scrollbar { display: none; }

/* Modal de detalhe: card modular de altura fixa, afastado da dock */
.dock-wrap[data-mode="detail"] .panel {
  width: min(880px, 92vw);
  height: min(74vh, 620px);
  max-height: none;
  bottom: calc(100% + 16px);
  padding: 0;
  overflow: hidden;            /* o scroll fica só na coluna de mídia */
}
/* A view de detalhe preenche o card e organiza head (fixo) + corpo.
   `.is-active` no seletor garante prioridade sobre a regra que põe
   display:block na view ativa (mesma especificidade, definida antes). */
.dock-wrap[data-mode="detail"] .panel-view.panel-detail.is-active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.dock-wrap[data-open="true"] .panel {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

/* Só a view ativa aparece, com entrada suave */
.panel-view { display: none; }
.dock-wrap[data-open="true"] .panel-view.is-active {
  display: block;
  animation: viewIn 0.45s var(--ease);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Linhas (work / contact) ──────────────────────────────────────── */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  border-radius: 15px;
  text-decoration: none;
  color: inherit;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.row.is-clickable { cursor: pointer; }
.row + .row { position: relative; }
.row + .row::before {
  content: "";
  position: absolute;
  top: 0; left: 12px; right: 12px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Hover: lift sutil + avatar inclinando + chevron deslizando */
.row:hover { background: rgba(255, 255, 255, 0.1); transform: translateX(3px); }
.row:hover::before, .row:hover + .row::before { background: transparent; }
.row:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

.av {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    background 0.4s var(--ease);
}
.av svg { width: 16px; height: 16px; }
.row:hover .av {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 6px 16px rgba(0, 0, 0, 0.22);
}

.row-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.row-title { color: var(--glass-text); font-weight: 600; font-size: 0.83rem; }
.row-sub {
  color: var(--glass-dim);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-meta {
  flex: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--mono);
  font-size: 0.76rem;
}
.row-go {
  flex: none;
  max-width: 0;
  margin-left: 0;
  opacity: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.15rem;
  line-height: 1;
  transition: max-width 0.35s var(--ease), opacity 0.3s var(--ease),
    margin-left 0.35s var(--ease);
}
.row.is-clickable:hover .row-go { max-width: 18px; margin-left: 4px; opacity: 1; }

/* ── About ────────────────────────────────────────────────────────── */
.about-bio {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.94rem;
  line-height: 1.55;
  font-weight: 300;
  padding: 6px 8px 12px;
}
.facts { display: flex; flex-direction: column; }
.fact {
  display: flex;
  gap: 16px;
  padding: 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.fact-key {
  flex: none;
  width: 88px;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  padding-top: 3px;
}
.fact-val { color: var(--glass-text); font-size: 0.9rem; line-height: 1.5; }

/* Facts clicáveis: "Based in" (mapa) e "Awards" (modal de detalhe) */
.fact--map,
.fact--detail {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.3s var(--ease);
}
.fact--map:hover,
.fact--detail:hover { background: rgba(255, 255, 255, 0.08); }
.fact--map:focus-visible,
.fact--detail:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

/* ── Modal de detalhe ─────────────────────────────────────────────── */
.detail-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 4px;
}
.detail-back, .detail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--sans);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.3s var(--ease), transform 0.2s var(--ease);
}
.detail-close { width: 32px; padding: 0; font-size: 1.2rem; line-height: 1; }
.detail-back:hover, .detail-close:hover { background: rgba(255, 255, 255, 0.18); }
.detail-back:active, .detail-close:active { transform: scale(0.94); }

.detail-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 26px;
  padding: 26px 22px 22px;
}
/* Esquerda: conteúdo fixo (não rola) */
.detail-left {
  min-height: 0;
  overflow: hidden;
}
.detail-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.detail-row { margin-bottom: 15px; }
.detail-key {
  display: block;
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 5px;
}
.detail-val { color: rgba(255, 255, 255, 0.9); font-size: 0.9rem; line-height: 1.55; }

/* Coluna de mídia: dinâmica, rola para ver o resto do conteúdo */
.detail-media {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-right: 2px;
}
.detail-media::-webkit-scrollbar { display: none; }

/* Bloco grande (vídeo) ocupando toda a largura da seção */
.media-full {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #0b0b0d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Par de fotos lado a lado */
.media-pair {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.media-cell {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(20, 20, 22, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
/* Par de retratos: células verticais (3:4) pra fotos em pé não cortarem */
.media-pair--portrait .media-cell { aspect-ratio: 3 / 4; }

/* Bloco "feature": 2 fotos empilhadas à esquerda + vídeo (reel) à direita.
   As células 9:8 definem a altura; o vídeo estica pra cobrir as duas (≈9:16). */
.media-feature {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.media-feature__cell,
.media-feature__reel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #0b0b0d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.media-feature__cell { aspect-ratio: 9 / 8; }
.media-feature__reel { grid-column: 2; grid-row: 1 / span 2; }
.media-feature__cell:hover .media-el,
.media-feature__reel:hover .media-el { transform: scale(1.03); }

/* Mapa (maplibre) embutido na coluna de mídia do detalhe ("Based in").
   Bloco de tamanho definido no topo da coluna (igual aos blocos de mídia);
   o maplibre é renderizado direto neste elemento. */
.detail-map {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #1a1a1f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.3);
}
.detail-map .maplibregl-ctrl-attrib {
  background: rgba(20, 20, 24, 0.55);
  font-size: 10px;
}
.detail-map .maplibregl-ctrl-attrib a { color: rgba(255, 255, 255, 0.7); }

/* Player do Spotify (iframe oficial) abaixo do About.
   O interior é cross-origin (não estilizável); enquadramos como os blocos
   de mídia do site: card escuro, hairline branca e sombra suave. */
.detail-spotify {
  margin-top: 32px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.3);
}
.spotify-embed {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 14px;
}

/* ── Preview do GitHub (popover no hover, ao lado do Contact) ───────── */
.gh-preview {
  position: fixed;
  z-index: 30;
  width: 310px;
  max-width: 92vw;
  padding: 13px;
  border-radius: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateX(-6px) scale(0.98);
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.gh-preview[hidden] { display: none; }
.gh-preview[data-show="true"] { opacity: 1; transform: none; }
.gh-preview-head { display: flex; align-items: center; gap: 10px; }
.gh-preview-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-line);
  object-fit: cover;
}
.gh-preview-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gh-preview-name { color: var(--glass-text); font-weight: 600; font-size: 0.9rem; }
.gh-preview-user { color: var(--glass-dim); font-size: 0.76rem; font-family: var(--mono); }
.gh-preview-graph { display: flex; flex-direction: column; gap: 10px; }
.gh-graph-head { color: var(--glass-text); font-size: 0.84rem; font-weight: 600; }
.gh-graph {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, auto);
  gap: 2px;
  width: 100%;
}
.gh-cell {
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}
.gh-cell[data-empty] { background: transparent; }
.gh-cell[data-level="1"], .gh-legend i[data-level="1"] { background: #0e4429; }
.gh-cell[data-level="2"], .gh-legend i[data-level="2"] { background: #006d32; }
.gh-cell[data-level="3"], .gh-legend i[data-level="3"] { background: #26a641; }
.gh-cell[data-level="4"], .gh-legend i[data-level="4"] { background: #39d353; }
.gh-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--glass-dim);
  font-size: 0.72rem;
  font-family: var(--mono);
}
.gh-legend i {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}
.gh-loading, .gh-fallback {
  margin: auto;
  color: var(--glass-dim);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.5;
}
.gh-fallback a { color: var(--glass-text); }

/* ── Preview de perfil no hover (LinkedIn, X…): banner + avatar + botão.
   O banner vem por imagem inline (background-image) em cada card. ───── */
.profile-card {
  position: fixed;
  z-index: 30;
  width: 280px;
  max-width: 92vw;
  border-radius: 18px;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  opacity: 0;
  transform: translateX(-6px) scale(0.98);
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease);
}
.profile-card[hidden] { display: none; }
.profile-card[data-show="true"] { opacity: 1; transform: none; }
.pc-banner {
  position: relative;
  height: 64px;
  background-color: #2a2a2e;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.pc-avatar {
  position: absolute;
  top: 28px;
  left: 16px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.92);
  object-fit: cover;
  background: #1c1c1f;
}
.pc-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 38px 16px 16px;
}
.pc-name { color: var(--glass-text); font-weight: 700; font-size: 1rem; }
.pc-sub { color: var(--glass-dim); font-size: 0.8rem; line-height: 1.35; }
.pc-meta { color: rgba(255, 255, 255, 0.45); font-size: 0.74rem; margin-top: 1px; }
.pc-btn {
  margin-top: 13px;
  display: block;
  text-align: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: var(--glass-text);
  font-weight: 600;
  font-size: 0.86rem;
  text-decoration: none;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.pc-btn:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-1px); }

/* Vídeo vertical (reel): centralizado, 9:16, sem corte */
.media-reel {
  position: relative;
  flex: none;
  align-self: center;
  width: min(320px, 64%);
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  background: #0b0b0d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 34px rgba(0, 0, 0, 0.34);
}

/* Mídia: cover preenche a caixa (sem bordas pretas); recorta o excedente.
   Para não perder conteúdo, exporte os arquivos na proporção da caixa:
   blocos grandes (vídeo) em 16:9, fotos em par em 16:10. */
.media-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}
.media-cell:hover .media-el { transform: scale(1.03); }

/* Fallback quando não há mídia: gradiente + iniciais (+ logo) */
.media-hero--logo { display: grid; place-items: center; }
.media-hero--logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 25% 15%, rgba(255, 255, 255, 0.22), transparent 55%);
}
.hero-mark {
  position: relative;
  z-index: 1;
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.95);
  transform: rotate(-9deg);
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}
.hero-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12%;
}
/* Links para a página da experiência */
.detail-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.detail-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.3s var(--ease), transform 0.2s var(--ease);
}
.detail-link:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
.detail-link:active { transform: scale(0.96); }

/* ── Modal do mapa (Based in → João Pessoa) ───────────────────────── */
.map-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 32px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.map-modal[hidden] { display: none; }
.map-modal[data-open="true"] { opacity: 1; pointer-events: auto; }
.map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.5);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}
.map-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  height: min(64vh, 480px);
  border-radius: 22px;
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  /* Mesma entrada do modal de work (.panel): cresce de baixo, com fade. */
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transform-origin: bottom center;
  transition: opacity 0.35s var(--ease), transform 0.4s var(--ease);
}
.map-modal[data-open="true"] .map-modal-card { opacity: 1; transform: none; }
.map-modal-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-line);
}
.map-modal-place { display: flex; flex-direction: column; gap: 1px; }
.map-modal-title { color: var(--glass-text); font-weight: 600; font-size: 0.95rem; }
.map-modal-sub {
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.map-modal-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s var(--ease), transform 0.2s var(--ease);
}
.map-modal-close:hover { background: rgba(255, 255, 255, 0.18); }
.map-modal-close:active { transform: scale(0.94); }
.map-modal-canvas {
  flex: 1 1 auto;
  min-height: 0;
  background: #1a1a1f;
}

/* Atribuição CARTO/OSM (mantida por conformidade, em tom discreto) */
.map-modal-canvas .maplibregl-ctrl-attrib {
  background: rgba(20, 20, 24, 0.55);
  font-size: 10px;
}
.map-modal-canvas .maplibregl-ctrl-attrib a { color: rgba(255, 255, 255, 0.7); }

/* Marcador (replica o mapcn: dot com borda branca + anel pulsante) */
.map-pin { position: relative; width: 16px; height: 16px; }
.map-pin-dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--pin);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.map-pin-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--pin);
  animation: pinPulse 2.4s var(--ease) infinite;
}
@keyframes pinPulse {
  0%   { transform: scale(1); opacity: 0.5; }
  70%  { transform: scale(3); opacity: 0; }
  100% { transform: scale(3); opacity: 0; }
}

/* ── Dock (barra de ícones) ───────────────────────────────────────── */
.dock {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 22px;
  background: var(--glass-bg);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--glass-line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.dock-item {
  display: flex;
  align-items: center;
  height: 46px;
  min-width: 46px;
  padding: 0 12px;
  border-radius: 15px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    transform 0.2s var(--ease);
}
.dock-item:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.dock-item:active { transform: scale(0.92); }
.dock-item:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.dock-item.is-active { background: rgba(255, 255, 255, 0.18); color: #fff; }
.dock-item svg { width: 22px; height: 22px; flex: none; }

.dock-label {
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 500;
  transition: max-width 0.4s var(--ease), opacity 0.3s var(--ease),
    margin-left 0.4s var(--ease);
}
.dock-item.is-active .dock-label { max-width: 100px; margin-left: 8px; opacity: 1; }

/* ── Metadados na faixa branca ────────────────────────────────────── */
.meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(8px, 1.4vh, 14px) clamp(6px, 1vw, 12px);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.meta-left, .meta-right { display: flex; align-items: center; gap: clamp(14px, 3vw, 40px); }
.meta-name {
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.25s var(--ease);
}
a.meta-name:hover { opacity: 0.55; text-decoration: underline; text-underline-offset: 3px; }
a.meta-name:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 2px; }
.meta-role, .meta-loc, .meta-year { color: var(--ink-dim); }
.meta-time { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ── Responsivo ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Em telas pequenas o card volta a rolar inteiro (coluna única) */
  .dock-wrap[data-mode="detail"] .panel {
    height: auto;
    max-height: min(80vh, 640px);
    overflow-y: auto;
    bottom: calc(100% + 12px);
  }
  .detail-body {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 16px;
    padding: 4px 16px 18px;
  }
  .detail-left, .detail-media { overflow: visible; height: auto; }
  .map-modal-card { width: 100%; height: min(72vh, 520px); }
}
@media (max-width: 600px) {
  .meta { font-size: 0.6rem; }
  .meta-left, .meta-right { gap: 12px; }
  .meta-role, .meta-year { display: none; }
  .dock-item { height: 44px; min-width: 44px; padding: 0 10px; }
}
@media (max-width: 380px) {
  .meta-loc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sound-toggle.is-muted { animation: none; }
  .panel, .panel-view, .dock-item, .dock-label, .row, .av, .sound-toggle { transition: none; animation: none; }
  .map-pin-pulse { animation: none; opacity: 0; }
  .map-modal, .map-modal-card, .fact--map, .fact--detail { transition: none; }
}
