/* Project Explorer (Horizonte): índice compacto na abertura (desktop) e painel "Explorar projetos" (celular e, no desktop,
   durante os capítulos). Só escolhe o capítulo: a ida usa os traços e a cortina que a Horizonte já tem.
   Sem JS, o índice vira uma lista de links para os cases. Nada se desloca em hover ou pressão (MOTION-SYSTEM.md). */
.hx__filters { display: flex; flex-wrap: wrap; gap: 6px; }
html:not(.js) .hx__filters, html:not(.js) .hx-open { display: none; }
.hx__f { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid rgb(245 242 237 / .22); border-radius: 999px; background: rgb(11 15 20 / .35); color: rgb(245 242 237 / .82); cursor: pointer; font: 600 14px/1 "Manrope", "Manrope Fallback", sans-serif; -webkit-tap-highlight-color: transparent; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.hx__f .c { font: 500 12px/1 "JetBrains Mono", monospace; letter-spacing: .06em; opacity: .6; }
.hx__f[aria-pressed="true"] { background: var(--off); border-color: var(--off); color: var(--ink); }
.hx__f:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
@media (hover: hover) and (pointer: fine) { .hx__f[aria-pressed="false"]:hover { border-color: rgb(245 242 237 / .55); color: var(--off); } }
.hx__f:active, .hx__f.is-pressed { background: rgb(245 242 237 / .16); transition-duration: var(--dur-press); }
.hx__f[aria-pressed="true"]:active { background: rgb(245 242 237 / .86); }

.hx__list { margin: 14px 0 0; padding: 0; list-style: none; border-top: 1px solid rgb(245 242 237 / .16); }
.hx__list li { border-bottom: 1px solid rgb(245 242 237 / .16); }
.hx__list li.is-enter { animation: hx-in var(--dur-base) var(--ease-out) both; animation-delay: calc(var(--k, 0) * 40ms); }
@keyframes hx-in { from { opacity: 0; transform: translateY(var(--shift-sm)); } }
.hx__p { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) 20px; align-items: baseline; column-gap: 8px; min-height: 48px; padding: 10px 2px; color: var(--off); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.hx__p .n { font: 500 12px/1.4 "JetBrains Mono", monospace; letter-spacing: .08em; color: rgb(245 242 237 / .5); transition: color var(--dur-fast) var(--ease-out); }
.hx__p .nm { position: relative; justify-self: start; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.hx__p .nm::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right center; transition: transform var(--dur-base) var(--ease-out); }
.hx__p .d { grid-column: 2; font: 500 12px/1.5 "JetBrains Mono", monospace; letter-spacing: .07em; text-transform: uppercase; color: rgb(245 242 237 / .55); }
.hx__p .go { grid-column: 3; grid-row: 1; justify-self: end; display: grid; place-items: center; width: 20px; height: 20px; overflow: hidden; color: rgb(245 242 237 / .5); }
.hx__p .go svg { transition: transform var(--dur-reveal) var(--ease-out); }
/* capítulo atual: ponto terracota no lugar do número (mesma largura; nada se desloca) */
.hx__p[aria-current="true"] .n { color: transparent; background: radial-gradient(circle, var(--terra) 3px, transparent 3.5px) left 3px center / 10px 10px no-repeat; }
.hx__p:focus-visible { outline: var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.hx__p:focus-visible .nm::after { transform: scaleX(1); transform-origin: left center; }
@media (hover: hover) and (pointer: fine) {
  .hx__p:hover .nm::after { transform: scaleX(1); transform-origin: left center; }
  .hx__p:hover .go { color: var(--off); } .hx__p:hover .go svg { transform: translate(1px, -1px); }
  .hx__p:hover .n { color: var(--copper-l); }
}
.hx__p:active .nm, .hx__p.is-pressed .nm { opacity: .72; transition: opacity var(--dur-press); }
.hx__empty { margin: 14px 0 0; color: rgb(245 242 237 / .65); font-size: 14px; }

/* abertura (desktop): índice à direita do título; some quando os capítulos começam */
.js .hx--inline { display: none; }
@media (min-width: 900px) and (min-height: 560px) {
  .js .hx--inline { display: block; position: absolute; top: calc(var(--header-h) + 76px); right: max(var(--gutter), env(safe-area-inset-right)); width: min(380px, 30vw); pointer-events: auto; animation: hx-in .6s .1s var(--ease-out) both; }
  .js .hz.is-ch .hx--inline { visibility: hidden; }
  .js .hx--inline .hx__list { max-height: calc(var(--hx-room, 60vh)); }
}
/* sem JS: o índice aparece abaixo do título, como lista de cases */
html:not(.js) .hx--inline { max-width: 480px; margin-top: 32px; }

/* botão Explorar projetos: cápsula pequena no topo do palco (celular sempre; desktop durante os capítulos) */
.hx-open { position: absolute; z-index: 7; top: calc(var(--header-h) + env(safe-area-inset-top) + 2px); right: max(var(--gutter), env(safe-area-inset-right)); display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 12px; border: 0; border-radius: 999px; background: var(--glass-clear-bg); -webkit-backdrop-filter: var(--glass-clear-filter); backdrop-filter: var(--glass-clear-filter); box-shadow: var(--glass-rim), var(--glass-shadow); color: var(--off); cursor: pointer; font: 600 14px/1 "Manrope", "Manrope Fallback", sans-serif; -webkit-tap-highlight-color: transparent; transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), opacity var(--dur-base) var(--ease-out), visibility var(--dur-base); }
.hx-open__ico { display: grid; gap: 3px; width: 14px; }
.hx-open__ico i { display: block; height: 1.5px; border-radius: 1px; background: currentColor; transform-origin: left center; transition: transform var(--dur-base) var(--ease-out); }
.hx-open__ico i:nth-child(2) { transform: scaleX(.64); } .hx-open__ico i:nth-child(3) { transform: scaleX(.82); }
.hx-open:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.hx-open:focus-visible .hx-open__ico i { transform: none; }
@media (hover: hover) and (pointer: fine) { .hx-open:hover { background-color: var(--glass-clear-hover); } .hx-open:hover .hx-open__ico i { transform: none; } }
.hx-open:active, .hx-open.is-pressed { background-color: var(--glass-clear-hover); transition-duration: var(--dur-press); }
.hx-open:active .hx-open__ico, .hx-open.is-pressed .hx-open__ico { scale: .86; }
@media (min-width: 900px) and (min-height: 560px) { .hz:not(.is-ch) .hx-open { opacity: 0; visibility: hidden; } }
@media not all and (min-width: 900px) and (min-height: 560px) { .js .hz-top .hz-count { visibility: hidden; } }

/* painel: folha que sobe no celular; coluna à direita no desktop */
html.hx-lock { overflow: hidden; }
.hx-panel { width: 100%; max-width: 100vw; height: 100%; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: transparent; color: var(--off); }
.hx-panel[open] { display: grid; align-items: end; }
.hx-panel::backdrop { background: rgb(7 9 12 / .72); }
.hx-panel__in { display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: min(86dvh, 720px); padding: 0 max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); border-top: 1px solid rgb(245 242 237 / .14); border-radius: 20px 20px 0 0; background: #0f141a; box-shadow: 0 -24px 60px rgb(0 0 0 / .45); }
.hx-panel__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 16px; }
.hx-panel__t { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.hx--panel { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.hx--panel .hx__f { min-height: 44px; padding: 0 14px; }
.hx--panel .hx__p { min-height: 64px; padding: 14px 2px; }
.hx--panel .hx__p .nm { font-size: 20px; }
.hx-x { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border: 1px solid rgb(245 242 237 / .2); border-radius: 999px; background: none; color: var(--off); cursor: pointer; font: 500 12px/1 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
.hx-x i { display: inline-grid; place-items: center; width: 12px; height: 12px; transition: transform var(--dur-base) var(--ease-out); }
.hx-x:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.hx-x:focus-visible i { transform: rotate(90deg); }
@media (hover: hover) and (pointer: fine) { .hx-x:hover { border-color: var(--copper-l); } .hx-x:hover i { transform: rotate(90deg); } }
.hx-x:active, .hx-x.is-pressed { background: rgb(245 242 237 / .08); transition-duration: var(--dur-press); }
.hx-x:active i, .hx-x.is-pressed i { transform: rotate(90deg) scale(.8); transition-duration: var(--dur-press); }
@media (min-width: 900px) and (min-height: 560px) {
  .hx-panel[open] { justify-items: end; align-items: stretch; }
  .hx-panel__in { width: 440px; max-height: none; height: calc(100dvh - 32px); margin: 16px; padding: 0 28px 24px; border: 1px solid rgb(245 242 237 / .14); border-radius: 18px; box-shadow: 0 30px 80px rgb(0 0 0 / .5); }
}
@media (prefers-reduced-motion: reduce) { .hx__list li.is-enter, .js .hx--inline { animation: none; } }

/* Ajustes de encaixe (02/11): o índice da abertura cabe acima da linha do horizonte (58% da altura); linhas de uma só
   linha; em telas baixas o índice dá lugar ao botão. No celular o botão alinha com a linha "Projetos · 05". */
@media (min-width: 900px) and (min-height: 560px) {
  .js .hx--inline { top: calc(var(--header-h) + 72px); width: min(540px, 40vw); }
  .js .hz:not(.is-ch) .hz-top .hz-count { visibility: hidden; }
  .hx--inline .hx__filters { gap: 5px; }
  .hx--inline .hx__f { min-height: 32px; padding: 0 10px; font-size: 14px; }
  .hx--inline .hx__list { margin-top: 12px; }
  .hx--inline .hx__p { grid-template-columns: 26px auto minmax(0, 1fr) 16px; min-height: 34px; padding: 6px 2px; align-items: center; }
  .hx--inline .hx__p .nm { font-size: 15.5px; }
  .hx--inline .hx__p .d { grid-column: 3; grid-row: 1; justify-self: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 12px; font-size: 12px; }
  .hx--inline .hx__p .go { grid-column: 4; width: 16px; }
}
/* quando o índice não cabe acima do horizonte (telas baixas ou estreitas; medido no explorer.js), vira o botão */
@media (min-width: 900px) and (min-height: 560px) {
  .js .hz.hx-tight .hx--inline { display: none; }
  .js .hz.hx-tight:not(.is-ch) .hz-top .hz-count { visibility: visible; }
  .hz.hx-tight:not(.is-ch) .hx-open { opacity: 1; visibility: visible; top: calc(var(--header-h) + 40px); }
}
@media not all and (min-width: 900px) and (min-height: 560px) {
  .hx-open { top: calc(var(--header-h) - 6px); min-height: 36px; padding: 0 14px 0 12px; font-size: 14px; }
  .hx-open::after { content: ""; position: absolute; inset: -4px 0; }
}
