/* ── HOME — composição à escala da mockup (1280 unidades de largura) ──
   Cada elemento tem --x/--y (e --w/--h) em unidades da mockup, relativos ao topo do seu bloco.
   Os blocos não criam "stacking context", por isso o z-index dos elementos segue a ordem de pintura da mockup. */
.design-wrap { overflow-x: clip; }
.hm { --u: calc(100cqw / 1280); position: relative; background: #E8E8E8; }
.hm-block { position: relative; height: calc(var(--bh) * var(--u)); }
.hm-e { position: absolute; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u)); margin: 0; }
.hm-dc, .hm-lt { display: block; pointer-events: none; max-width: none; }
svg.hm-e { display: block; overflow: visible; }
svg.cobra .celula { shape-rendering: geometricPrecision; }

/* texto */
.hm-t { width: auto; height: auto; font: 400 calc(var(--s) * var(--u))/calc(var(--lh) * var(--u)) 'AzoSans', sans-serif; white-space: nowrap; }
.hm-t.hm-u, .hm-t.hm-h { font-family: 'AzoSansUber', 'AzoSans', sans-serif; }
.hm-t.hm-ls { letter-spacing: .06em; }
.hm-link { display: block; z-index: 6000; border-radius: 999px; }

/* placeholders de fotografia (se existir /assets/images/home/<nome>, aparece a foto) */
/* fotografias: <img> com object-fit */
.hm-ph { display: block; object-fit: cover; border-radius: var(--r, 0); max-width: none; }
.hm-ph.png { object-fit: contain; }
.hm-ph-fill { position: absolute; inset: 0; width: 100%; height: 100%; }
.hm-e.hm-ph { position: absolute; }

/* hero: foto + lettering + lema (em desktop os filhos usam as coordenadas do bloco) */
.hm-hero-card { display: contents; }
.hm-g { display: contents; }

/* ── Clientes: carrossel sempre a andar ── */
.hm-clientes { overflow: visible; }
.hm-cl-vp { position: relative; width: 100%; height: 100%; overflow: hidden; }
.hm-cl-track { display: flex; gap: calc(48 * var(--u)); width: max-content; will-change: transform; }
.hm-cl-card { width: calc(333 * var(--u)); flex: none; }
.hm-cl-nome { font: 400 calc(17.6 * var(--u))/calc(21.12 * var(--u)) 'AzoSansUber', sans-serif; color: var(--blue); height: calc(56.32 * var(--u)); padding-top: 0; margin: 0; white-space: nowrap; }
.hm-cl-img { display: block; position: relative; width: 100%; height: calc(263 * var(--u)); overflow: hidden; }
.hm-cl-ov { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(30 * var(--u)); opacity: 0; transition: opacity .35s; }
.hm-cl-ov b { font: 400 calc(14.96 * var(--u)) 'AzoSansUber', sans-serif; color: var(--yellow); }
.hm-cl-ov i { font: 400 calc(10.21 * var(--u)) 'AzoSansUber', sans-serif; color: #E8E8E8; font-style: normal; }
.hm-cl-img:hover .hm-cl-ov, .hm-cl-img:focus-visible .hm-cl-ov { opacity: 1; }
.hm-cl-desc { font: 400 calc(14.96 * var(--u))/calc(17.6 * var(--u)) 'AzoSans', sans-serif; color: #000; padding: calc(26.4 * var(--u)) calc(10.56 * var(--u)) 0; margin: 0; width: calc(266.64 * var(--u)); }
.hm-seta { border: 0; background: none; cursor: pointer; padding: 0; z-index: 6001; }
.hm-seta::before { content: ''; position: absolute; left: 50%; top: 50%; width: 38%; height: 52%; border: solid var(--blue); border-width: 0 0 calc(5 * var(--u)) calc(5 * var(--u)); transform: translate(-30%, -50%) rotate(45deg); filter: drop-shadow(0 4px 6px rgba(0,0,0,.28)); }
.hm-seta-dir::before { transform: translate(-70%, -50%) rotate(-135deg); }

/* ── Podcast: carrossel ── */
.hm-pod { overflow: hidden; }
.hm-pod-track { display: flex; gap: calc(7 * var(--u)); width: max-content; will-change: transform; }
.hm-pod-slide { position: relative; display: block; width: calc(206 * var(--u)); height: calc(288 * var(--u)); flex: none; overflow: hidden; }
.hm-pod-ov { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: 0; transition: opacity .35s; }
.hm-pod-ov i { font: 400 calc(10.21 * var(--u))/calc(12.32 * var(--u)) 'AzoSansUber', sans-serif; color: var(--yellow); font-style: normal; }
.hm-pod-ov b { font: 400 calc(10.21 * var(--u)) 'AzoSansUber', sans-serif; color: #E8E8E8; margin-top: calc(26.4 * var(--u)); }
.hm-pod-slide:hover .hm-pod-ov { opacity: 1; }
.hm-seta-pod::before { border-color: #E8E8E8; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }

/* ── Contactos: formulário ── */
.hm-form { display: contents; }
.hm-lab { width: auto; height: auto; font: 400 calc(16.81 * var(--u))/calc(19.36 * var(--u)) 'AzoSans', sans-serif; color: var(--blue); white-space: nowrap; }
.hm-fld { border: 1px solid var(--blue); border-radius: calc(21 * var(--u)); background: transparent; overflow: hidden; }
.hm-fld-area { border-radius: calc(26 * var(--u)); }
.hm-fld input, .hm-fld textarea { width: 100%; height: 100%; border: 0; background: transparent; padding: 0 calc(20 * var(--u)); font: 400 calc(17 * var(--u)) 'AzoSans', sans-serif; color: var(--blue); outline: none; resize: none; }
.hm-fld textarea { padding: calc(14 * var(--u)) calc(20 * var(--u)); }
.hm-fld:focus-within { box-shadow: 0 0 0 2px rgba(0,97,204,.25); }
.hm-submit { border: 0; border-radius: 999px; background: var(--yellow); color: var(--blue); font: 400 calc(21.6 * var(--u)) 'AzoSansUber', sans-serif; cursor: pointer; }
.hm-aviso { position: absolute; left: calc(92 * var(--u)); top: calc(1000 * var(--u)); font: 400 calc(17 * var(--u)) 'AzoSans', sans-serif; color: var(--blue); z-index: 940; }

/* ── Telemóvel: mesma ordem e mesmos elementos, em coluna ── */
@media (max-width: 900px) {
  .hm { --u: calc(100cqw / 700); }
  .hm-block { height: auto; display: flex; flex-direction: column; align-items: flex-start; gap: calc(30 * var(--u)); padding: calc(46 * var(--u)) calc(34 * var(--u)); }
  #hero { padding-top: calc(10 * var(--u)); padding-bottom: calc(26 * var(--u)); }
  .hm-e { position: static; left: auto; top: auto; transform: none !important; width: auto; height: auto; z-index: auto !important; }
  .hm-dc, svg.hm-solo { display: none; }
  .hm-e.hm-ph { position: static; }
  .hm-t { white-space: normal; font-size: max(15px, calc(var(--s) * var(--u) * 1.15)); line-height: 1.3; max-width: 100%; }
  .hm-t.hm-h { line-height: 1.12; }
  .hm-flow br { display: none; }
  .hm-t[style*="--s:1"], .hm-t[style*="--s:2"] { }
  .hm-lt { width: min(100%, calc(var(--w) * var(--u) * 1.2)); height: auto; }
  .hm-ph { width: 100%; height: auto; aspect-ratio: calc(var(--w) / var(--h)); }
  .hm-ph.arco { width: min(100%, calc(var(--w) * var(--u))); }
  svg.cobra { width: min(100%, calc(var(--w) * var(--u))); height: auto; align-self: flex-start; overflow: visible; }
  .hm-link { position: relative; width: 100%; height: calc(var(--h) * var(--u) * 1.3); min-height: 44px; margin-top: -8px; }
  .hm-link { background: none; }
  /* hero */
  .hm-hero-card, .hm-foto-card { display: block; position: relative; width: 100%; aspect-ratio: 4 / 5; container-type: inline-size; overflow: hidden; }
  .hm-hero-card .hm-ph, .hm-foto-card .hm-ph { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
  .hm-hero-card .hm-lt { position: absolute; left: 8%; top: 18%; width: 84%; }
  .hm-hero-card .hm-hero-lema { position: absolute; left: 10%; bottom: 17%; font-size: 6.4cqw; line-height: 1.18; max-width: 82%; }
  .hm-hero-card .hm-hero-lema br { display: inline; }
  .hm-hero-card .hm-hero-sub { position: absolute; left: 10%; bottom: 9%; font-size: 3.3cqw; max-width: 82%; }
  .hm-foto-card { aspect-ratio: 4 / 5; }
  .hm-foto-card .hm-lt { position: absolute; right: 5%; top: 6%; width: 78%; }
  .hm-foto-card .hm-foto-txt { position: absolute; left: 6%; bottom: 5%; font-size: 5.4cqw; max-width: 88%; }
  .hm-ph.hm-ph-fill { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
  /* fundos dos blocos (as formas grandes da mockup não cabem no telemóvel) */
  #loja, #conexao { background: var(--blue); }
  #servicos, #podcast { background: var(--yellow); }
  #estudio > .hm-c-yel { background: var(--blue); padding: .55em 1.1em; border-radius: 999px; width: fit-content; }
  #estudio .hm-ls { background: var(--yellow); padding: .45em 1.1em; border-radius: 999px; }
  #servicos .hm-c-yel { background: var(--blue); padding: .45em 1.1em; border-radius: 999px; }
  #loja .hm-t[style*="#0061cc"] { background: var(--yellow); padding: .35em 1.1em; border-radius: 999px; }
  /* grupos */
  .hm-g { display: flex; flex-direction: column; gap: 12px; width: 100%; }
  .hm-g .hm-t { background: none !important; padding: 0 !important; width: auto !important; }
  .hm-g-sobre-txt { background: var(--blue); border-radius: 22px; padding: 22px 20px; gap: 14px; }
  .hm-g-pessoa { display: grid; grid-template-columns: 56% 1fr; gap: 4px 14px; align-items: end; }
  .hm-g-pessoa > :nth-child(1) { grid-row: 1 / 3; width: 100%; }
  .hm-g-pessoa > :nth-child(2) { align-self: end; }
  .hm-g-pessoa > :nth-child(3) { align-self: start; }
  .hm-g-loja-txt { gap: 12px; }
  .hm-g-loja-fotos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .hm-g-loja-fotos .hm-ph { width: 100%; height: auto; aspect-ratio: 1 / 1.08; box-sizing: border-box; border: 6px solid #fff; border-bottom-width: 30px; border-radius: 16px; }
  .hm-g-posts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
  .hm-g-post { gap: 6px; }
  .hm-g-post .hm-t { font-size: 13px; }
  .hm-g-post .hm-ph { aspect-ratio: 1 / 1; border-radius: 14px; }
  .hm-g-est-info { background: var(--blue); border-radius: 22px; padding: 22px 20px; gap: 14px; }
  .hm-g-est-info .hm-ls { background: var(--yellow) !important; padding: .45em 1.1em !important; border-radius: 999px; width: fit-content !important; }
  #loja svg.cobra, #estudio svg.cobra { order: 99; }
  #loja svg.cobra { display: none; }
  #loja svg#cb-loja-2, #loja svg#cb-loja-3 { display: block; }
  /* clientes: carrossel em coluna única visível */
  .hm-clientes { position: relative; width: 100%; }
  .hm-clientes .hm-cl-vp { height: auto; }
  .hm-cl-track { gap: calc(30 * var(--u)); }
  .hm-cl-card { width: 74vw; }
  .hm-cl-nome { font-size: max(17px, calc(22 * var(--u))); height: auto; margin-bottom: 8px; white-space: normal; }
  .hm-cl-img { height: auto; aspect-ratio: 333 / 263; }
  .hm-cl-desc { width: 100%; font-size: 15px; line-height: 1.3; padding: 14px 4px 0; }
  .hm-seta-cl { display: none; }
  .hm-cl-ov { opacity: 0; }
  /* podcast */
  .hm-pod { position: relative; width: 100%; }
  .hm-pod-track { gap: 8px; }
  .hm-pod-slide { width: 56vw; height: calc(56vw * 288 / 206); }
  .hm-pod-ov i, .hm-pod-ov b { font-size: 14px; line-height: 1.3; }
  .hm-seta-pod { display: none; }
  #podcast .hm-pod { order: 5; }
  #contactos .hm-t[style*="--x:809"] { order: 20; }
  #contactos .hm-lt { order: 21; }
  #contactos .hm-form { order: 10; }
  #contactos .hm-submit { order: 40 !important; }
  /* contactos: formulário */
  .hm-form { display: flex; flex-direction: column; gap: 14px; width: 100%; }
  .hm-lab { font-size: 16px; margin-bottom: -8px; }
  .hm-fld { width: 100%; height: 46px; border-radius: 23px; }
  .hm-fld-area { height: 160px; border-radius: 22px; }
  .hm-fld input, .hm-fld textarea { font-size: 16px; padding: 0 18px; }
  .hm-fld textarea { padding: 12px 18px; }
  .hm-submit { width: 180px; height: 44px; font-size: 18px; }
  .hm-aviso { position: static; }
}

/* avatar dos posts (anel em gradiente + disco azul) */
.hm-ava { border-radius: 50%; background: linear-gradient(35deg, #c4278f, #e04e4a); }
.hm-ava::before { content: ''; position: absolute; inset: calc(2.6 * var(--u)); border-radius: 50%; background: #fff; }
.hm-ava::after { content: ''; position: absolute; inset: calc(4.2 * var(--u)); border-radius: 50%; background: var(--blue); }
@media (max-width: 900px) { .hm-ava { display: none; } }

/* ── Telemóvel v2: cobras só como decoração nos cantos (entram pelas margens, como no desktop); clientes maiores ── */
@media (max-width: 900px) {
  .hm-block { position: relative; overflow: hidden; padding-top: 50px; padding-bottom: 60px; }
  .hm-block > :not(svg.cobra) { position: relative; z-index: 1; }
  svg.cobra, svg.cobra.hm-e { display: none !important; position: absolute !important; z-index: 0 !important; pointer-events: none; height: auto; aspect-ratio: calc(var(--w) / var(--h)); max-width: none; left: auto; top: auto; right: auto; bottom: auto; margin: 0; }
  #cb-hero-5, #cb-sobre-1, #cb-sobre-3, #cb-servicos-1, #cb-foto-1, #cb-loja-1, #cb-loja-4, #cb-projetos-1, #cb-conexao-2, #cb-podcast-1 { display: block !important; }
  #hero { padding-bottom: 120px; }
  #cb-hero-5 { width: 150px; right: -50px; bottom: -70px; }
  #sobre { padding-top: 100px; padding-bottom: 110px; }
  #cb-sobre-1 { width: 170px; right: -50px; top: -60px; }
  #cb-sobre-3 { width: 170px; right: -50px; bottom: -60px; }
  #servicos { padding-top: 100px; }
  #cb-servicos-1 { width: 220px; left: 0; top: -30px; }
  #foto { padding-top: 70px; }
  #cb-foto-1 { width: 170px; right: -40px; top: 0; }
  #loja { padding-top: 120px; padding-bottom: 150px; }
  #cb-loja-1 { width: 160px; right: -60px; top: -50px; }
  #cb-loja-4 { width: 240px; right: -70px; bottom: -70px; }
  #projetos { padding-bottom: 90px; }
  #cb-projetos-1 { width: 110px; right: 20px; bottom: 0; }
  #conexao { padding-bottom: 140px; }
  #cb-conexao-2 { width: 210px; left: -50px; bottom: -80px; }
  #podcast { padding-bottom: 120px; }
  #cb-podcast-1 { width: 200px; right: -60px; bottom: -70px; }
  /* clientes: cartões grandes, o 2.º já espreita */
  .hm-cl-card { width: 84vw; }
  .hm-cl-track { gap: 14px; }
  .hm-cl-nome { font-size: 20px; margin-bottom: 10px; }
  .hm-cl-desc { font-size: 16px; padding: 14px 6px 0; }
}

/* ── Telemóvel v3: detalhes da composição do desktop, adaptados ── */
@media (max-width: 900px) {
  /* sobre: caixa azul sobrepõe a foto da equipa, como no desktop */
  .hm-g-sobre-txt { width: 90%; align-self: flex-end; margin-top: -70px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
  /* pessoas: Beatriz foto à esquerda, Ricardo foto à direita (como no desktop) */
  .hm-g-pessoa { grid-template-columns: 54% 1fr; align-items: end; width: 100%; }
  .hm-g-pessoa + svg.cobra + .hm-g-pessoa, #sobre .hm-g-pessoa:last-of-type { grid-template-columns: 1fr 54%; }
  #sobre .hm-g-pessoa:last-of-type > :nth-child(1) { grid-column: 2; grid-row: 1 / 3; }
  #sobre .hm-g-pessoa:last-of-type > :nth-child(2), #sobre .hm-g-pessoa:last-of-type > :nth-child(3) { grid-column: 1; text-align: right; }
  #sobre .hm-g-pessoa:last-of-type > :nth-child(4) { grid-column: 1; grid-row: 3; }
  .hm-g-pessoa .hm-t:first-of-type { font-size: 28px; }
  /* estúdio: posts como cartões brancos inclinados (como os posts do desktop) */
  .hm-g-posts { gap: 22px 14px; padding: 8px 0 14px; }
  .hm-g-post { background: #fff; border-radius: 16px; padding: 10px; gap: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.14); }
  .hm-g-posts > .hm-g-post:nth-child(1) { transform: rotate(-4deg); }
  .hm-g-posts > .hm-g-post:nth-child(2) { transform: rotate(4deg) translateY(14px); }
  .hm-g-posts > .hm-g-post:nth-child(3) { transform: rotate(-3deg); }
  .hm-g-posts > .hm-g-post:nth-child(4) { transform: rotate(4deg) translateY(12px); }
  .hm-g-post .hm-ph { border-radius: 8px; }
  #estudio > .hm-t[style*="--s:13"] { line-height: 1.05; }
  /* loja: polaroids inclinadas */
  .hm-g-loja-fotos { gap: 20px 14px; }
  .hm-g-loja-fotos .hm-ph:nth-child(1) { transform: rotate(-5deg) !important; }
  .hm-g-loja-fotos .hm-ph:nth-child(2) { transform: rotate(4deg) !important; }
  .hm-g-loja-fotos .hm-ph:nth-child(3) { transform: rotate(-3deg) !important; }
  .hm-g-loja-fotos .hm-ph:nth-child(4) { transform: rotate(3deg) !important; }
}

/* ── Telemóvel v4: correções vistas no Chrome ── */
@media (max-width: 900px) {
  .hm-g-pessoa .hm-t.hm-u { font-size: 21px !important; line-height: 1.2 !important; white-space: normal; transform: none; }
  #sobre .hm-g-pessoa:last-of-type > .hm-t { text-align: right; }
  #sobre .hm-g-pessoa:last-of-type > :nth-child(4) { text-align: right; }
  #conexao .hm-ph.png { width: 112% !important; max-width: none !important; margin-left: -6% !important; }
  #loja { padding-bottom: 100px; }
  #podcast { padding-bottom: 80px; }
}

/* ── Telemóvel v5: cobras todas à mesma escala (células iguais) e só junto às divisões entre secções ── */
@media (max-width: 900px) {
  svg.cobra, svg.cobra.hm-e { display: none !important; width: calc(var(--w) * .34px) !important; max-width: none !important; left: auto !important; right: auto !important; top: auto !important; bottom: auto !important; }
  #cb-hero-5, #cb-sobre-1, #cb-sobre-3, #cb-loja-1, #cb-conexao-2 { display: block !important; }
  #cb-hero-5 { right: 0 !important; bottom: 0 !important; }
  #cb-sobre-1 { right: 0 !important; top: 0 !important; }
  #cb-sobre-3 { right: 0 !important; bottom: 0 !important; }
  #cb-loja-1 { right: 0 !important; top: 0 !important; }
  #cb-conexao-2 { left: 0 !important; bottom: 0 !important; }
  #hero { padding-bottom: 90px; }
}

@media (max-width: 900px) {
  #cb-conexao-1, #cb-estudio-1, #cb-festival-1, #cb-festival-2, #cb-foto-1, #cb-foto-2, #cb-hero-1, #cb-hero-2, #cb-hero-3, #cb-hero-4, #cb-loja-2, #cb-loja-3, #cb-loja-4, #cb-podcast-1, #cb-projetos-1, #cb-servicos-1, #cb-servicos-2, #cb-sobre-2 { display: none !important; }
}

@media (max-width: 900px) {
  #cb-loja-1 { right: -70px !important; }
  #conexao { padding-bottom: 240px; }
}
@media (max-width: 900px) { #cb-loja-1 { display: none !important; } }