/* Home (gôndola) — expositor de postais. Cores vêm de /tokens.css. Sem textos na tela:
   o único texto é a pílula com o nome que acompanha o cursor. */

@font-face {
  font-family: 'General Sans';
  src: url('/fonts/GeneralSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

/* a Pollen desenha os próprios postais (canvas) */
@font-face {
  font-family: 'Pollen';
  src: url('/gondola/fonts/Pollen-Variable.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/gondola/fonts/IBMPlexSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* fundo próprio desta página */
:root { --color-bg: #DAE1E5; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background-color: var(--color-bg);
  overflow: hidden;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── Pílula do cursor (como em newapology.com) ─────────────────────── */

.tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6;
  pointer-events: none;
  will-change: transform;
}

.tip-pill {
  display: block;
  translate: -50% -50%;
  font-family: 'General Sans', Inter, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 18.2px;
  letter-spacing: normal;
  color: #fff;
  white-space: nowrap;
  padding: 9px 20px;
  border-radius: 19px;
  background: rgba(58, 92, 112, 0.35);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.tip.is-on .tip-pill {
  opacity: 1;
  transform: none;
}

/* ── Faixa do projeto (como em s-p.studio, sem borrão de movimento) ── */

.strip {
  position: fixed;
  inset: 0;
  z-index: 4;
  background-color: transparent;
  visibility: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color 0.5s cubic-bezier(0.6, 0, 0, 1), visibility 0s 0.5s;
}

.strip.is-on {
  visibility: visible;
  background-color: var(--color-bg);
  transition: background-color 0.5s cubic-bezier(0.6, 0, 0, 1), visibility 0s;
}

/* durante a passagem do postal para a faixa (e de volta), o fundo some e
   deixa ver o expositor atrás */
.strip.is-on.is-bare { background-color: transparent; }

.strip-track {
  position: absolute;
  inset: 0;
  transition: opacity 0.35s cubic-bezier(0.6, 0, 0, 1);
}

.strip-item {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  transform-origin: 50% 50%;
  will-change: transform, width, height;
  cursor: pointer;
}

.strip-item.is-center { cursor: default; }

/* capa já pronta por cima do vídeo de partida, até ele começar a tocar */
.strip-item .strip-cover { position: absolute; inset: 0; }

.strip-item img,
.strip-item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* só corta enquanto o postal 3:2 vira a imagem inteira */
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* ── Caixa de informação do projeto (Figma, nó 44:266) ─────────────── */

.strip-track {
  transition: opacity 0.6s cubic-bezier(0.6, 0, 0, 1), transform 0.8s cubic-bezier(0.6, 0, 0, 1), filter 0.6s cubic-bezier(0.6, 0, 0, 1);
}

/* aberta: as imagens desfocam, esmaecem e sobem um pouco */
.strip.is-info .strip-track {
  filter: blur(50px);
  opacity: 0.4;
  transform: translateY(-16vh);
}

.info-btn {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 3;
  translate: -50% 0;
  border: 0;
  cursor: pointer;
  font-family: 'General Sans', Inter, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 18.2px;
  color: #fff;
  padding: 9px 20px;
  border-radius: 19px;
  background: rgba(58, 92, 112, 0.35);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.6, 0, 0, 1) 0.3s, background-color 0.2s;
}
.strip.is-on:not(.is-bare) .info-btn { opacity: 1; }
.info-btn:hover { background: rgba(58, 92, 112, 0.5); }
.info-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  min-height: 52.3vh;
  max-height: 78vh;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 84px 26px 84px;
  background-image: linear-gradient(90deg, rgb(248, 158, 201) 55.135%, rgb(189, 255, 166) 81.019%, rgb(182, 254, 212) 92.882%, rgb(182, 230, 254) 98.922%);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  line-height: 21px;
  letter-spacing: -0.14px;
  color: #efff00;
  -webkit-font-smoothing: antialiased;
  transform: translateY(101%);
  visibility: hidden;
  transition: transform 0.8s cubic-bezier(0.6, 0, 0, 1), visibility 0s 0.8s;
  -webkit-user-select: text;
  user-select: text;
}
.strip.is-info .info {
  transform: none;
  visibility: visible;
  transition: transform 0.8s cubic-bezier(0.6, 0, 0, 1), visibility 0s;
}

.info-col { flex: 1 0 0; min-width: 1px; display: flex; flex-direction: column; gap: 10px; }
.info-body { max-width: 520px; }
.info-body p + p { margin-top: 19.6px; }
.info-label { font-size: 14px; line-height: 14px; opacity: 0.4; }
.info-facts { gap: 30px; color: #e9f355; font-size: 14px; line-height: 19.6px; }
.info-fact { display: flex; flex-direction: column; gap: 5px; }

@media (max-width: 760px) {
  .info { flex-direction: column; gap: 30px; padding: 40px 16px 84px; }
  .info-col { flex: none; width: 100%; }
}

/* ── Menu do topo e barra lateral de info (Figma, nós 44:227 e 44:237) ─ */

.menu {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 7;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 8px 0;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  line-height: 18px;
  color: #000;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
}
.menu-info {
  pointer-events: auto;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  transition: opacity 0.3s;
}
.menu-info:hover { opacity: 0.5; }
.menu-info:focus-visible, .about-close:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
body.is-about .menu-info { opacity: 0; pointer-events: none; }

.about-veil { position: fixed; inset: 0; z-index: 8; display: none; }
body.is-about .about-veil { display: block; }

.about {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  width: min(486.67px, 100vw);
  overflow-y: auto;
  padding: 84px 26px 34px;
  background-image: linear-gradient(180deg, rgb(248, 158, 201) 50%, rgb(189, 255, 166) 78.846%, rgb(182, 254, 212) 92.067%, rgb(182, 230, 254) 98.798%);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  line-height: 21px;
  letter-spacing: -0.14px;
  color: #efff00;
  -webkit-font-smoothing: antialiased;
  transform: translateX(101%);
  visibility: hidden;
  transition: transform 0.8s cubic-bezier(0.8, 0, 0, 1), visibility 0s 0.8s;   /* fechamento */
}
body.is-about .about {
  transform: none;
  visibility: visible;
  transition: transform 0.8s cubic-bezier(0.8, 0, 0, 1), visibility 0s;   /* abertura */
}
.about a { color: inherit; text-decoration: none; }
.about a:hover { text-decoration: underline; text-underline-offset: 2px; }
.about-close {
  position: absolute;
  top: 14.8px;
  right: 17.8px;
  font: inherit;
  font-size: 14px;
  line-height: 18px;
  letter-spacing: 0;
  color: #e9f355;
  background: none;
  border: 0;
  cursor: pointer;
}
.about-main { display: flex; flex-direction: column; gap: 10px; }
.about-body { display: flex; flex-direction: column; gap: 58px; }
.about-list { display: flex; flex-direction: column; gap: 30px; font-size: 14px; line-height: 19.6px; }
.about-list > div { display: flex; flex-direction: column; gap: 5px; }
.about-practices { max-width: 198px; }

/* ── Grade com todas as imagens (como em benmingo.com) ───────────── */

.grid {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-bg);
  visibility: hidden;
  -webkit-user-select: none;
  user-select: none;
}

/* medindo (antes do voo): ocupa o lugar, mas não aparece */
.grid.is-measuring { visibility: hidden; }
.grid.is-on { visibility: visible; }

.grid-inner {
  --cols: 12;
  --pad: 8px;
  --gap: 24px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: calc(var(--gap) * 1.2);
  /* topo: a linha do menu (8px + 18px) mais o mesmo espaço que separa as linhas */
  padding: calc(26px + var(--gap) * 1.2) var(--pad) calc(var(--pad) * 4);
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1.3;
}

.cell img,
.cell video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left top;     /* imagem inteira, alinhada no alto e à esquerda */
  -webkit-user-drag: none;
}

@media (max-width: 1100px) { .grid-inner { --cols: 8; } }
@media (max-width: 760px)  { .grid-inner { --cols: 4; --gap: 12px; } }

/* ── Utilitários ───────────────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.nojs {
  position: fixed;
  inset: auto 0 50% 0;
  text-align: center;
  font-family: 'General Sans', sans-serif;
  font-size: 16px;
  color: var(--color-nav);
}
.nojs a { color: inherit; }

@media (hover: none) {
  .tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tip-pill, .strip, .strip-track, .info, .about { transition-duration: 0.01s; }
}

/* ── Specimen da Pollen (o postal vira e se abre nele) ───────────────── */

.spec-veil { position: fixed; inset: 0; z-index: 8; display: none; }
body.is-spec .spec-veil { display: block; }

.spec {
  --spec-m: clamp(16px, 4.5vw, 64px);
  --spec-fg: #EEA9F1;
  --spec-bg: #EDEDED;
  position: fixed;
  top: max(var(--spec-m), 56px);
  right: var(--spec-m);
  bottom: var(--spec-m);
  left: var(--spec-m);
  z-index: 9;
  display: none;
  background: var(--spec-bg);
  color: var(--spec-fg);
  font-family: 'IBM Plex Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.spec.is-on { display: block; }

.spec-inner {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  pointer-events: none;
}
.spec.is-open .spec-inner { pointer-events: auto; }

/* a capa que faz a ponte com o verso do postal: mesmo desenho, mesma escala */
.spec-lid {
  position: absolute;
  display: block;
  pointer-events: none;
  background: var(--spec-bg);
}
.spec-lid text { font-family: 'Pollen', sans-serif; font-weight: 900; font-size: 220px; fill: var(--spec-fg); }

.spec-side {
  width: 220px;
  flex: none;
  padding: 16px 24px 36px;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}
.spec-name { font-family: 'Pollen', sans-serif; font-weight: 900; font-size: 50px; line-height: 1.1; margin-bottom: 48px; }
.spec-control {
  display: grid;
  grid-template-columns: 1fr auto;
  margin-bottom: 32px;
  cursor: pointer;
}
.spec-control-name { font-size: 12px; color: rgba(0, 0, 0, 0.4); margin-bottom: 14px; }
.spec-control-val { font-size: 11px; color: rgba(0, 0, 0, 0.55); font-variant-numeric: tabular-nums; }
.spec-control input { grid-column: 1 / -1; }
.spec input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 1px;
  background: rgba(0, 0, 0, 0.15);
  outline: none;
  cursor: pointer;
}
.spec input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px; border-radius: 50%; border: 0;
  background: var(--spec-fg);
}
.spec input[type="range"]::-moz-range-thumb {
  width: 10px; height: 10px; border-radius: 50%; border: 0;
  background: var(--spec-fg);
}
.spec-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  padding: 48px 60px;
  overflow: auto;
}
.spec-text {
  font-family: 'Pollen', sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  max-width: 100%;
  word-break: break-word;
  outline: none;
  cursor: text;
  margin: auto 0;
}

/* painel estreito (celular): controles em linhas no alto, texto embaixo */
@media (max-width: 720px) {
  .spec-inner { flex-direction: column; overflow-y: auto; }
  .spec-side { width: auto; padding: 14px 16px 20px; border-right: 0; border-bottom: 1px solid rgba(0, 0, 0, 0.1); overflow: visible; }
  .spec-name { font-size: 34px; margin-bottom: 20px; }
  .spec-controls { display: flex; flex-direction: column; gap: 12px; }
  .spec-control { display: flex; align-items: center; gap: 6px; margin: 0; }
  .spec-control-name { width: 56px; flex: none; margin: 0; font-size: 11px; }
  .spec-control-val { order: 3; width: 52px; flex: none; text-align: right; }
  .spec-control input { flex: 1; height: 24px; background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15)) center / 100% 1px no-repeat; }
  .spec-main { flex: none; padding: 28px 16px 40px; overflow: visible; }
}

/* ── Memory card: tela de dados salvos do PS2 (memcard.js) ───────────────
   Medidas e cores tiradas do vídeo de referência (BIOS europeia do PS2):
   --u = 1px da tela de 640×480. */
@font-face {
  font-family: 'M PLUS 1p';
  src: url('/gondola/fonts/MPLUS1p-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'M PLUS 1p';
  src: url('/gondola/fonts/MPLUS1p-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
.mc {
  position: fixed; inset: 0; z-index: 12;
  display: none; align-items: center; justify-content: center;
  background: rgba(14, 17, 22, 0);
  transition: background-color .4s;
}
.mc.is-open, .mc.is-closing { display: flex; }
.mc.is-open { background: rgba(14, 17, 22, .38); }
.mc-screen {
  --u: 1px;
  position: relative;
  width: min(92vw, calc(84vh * 4 / 3), 880px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: calc(var(--u) * 6);
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  font-family: 'M PLUS 1p', 'General Sans', sans-serif;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1;
  user-select: none; -webkit-user-select: none;
  opacity: 0; transform: scale(.94);
  transition: opacity .35s, transform .45s cubic-bezier(.2, .8, .2, 1);
}
.mc.is-open .mc-screen { opacity: 1; transform: none; }
.mc.is-closing .mc-screen { opacity: 0; transform: scale(.97); transition-duration: .35s; }
.mc-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mc-tint { opacity: 0; }
.mc-screen p { margin: 0; }
:where(.mc-screen button) { all: unset; cursor: pointer; }
.mc-screen small { font-size: .72em; }
.mc-screen > div, .mc-screen > p { position: absolute; }

/* letra do console: contorno escuro fino e uma sombra curta */
.mc-y, .mc-w, .mc-opt {
  text-shadow:
    calc(var(--u) * -1) 0 0 rgba(0,0,0,.7), calc(var(--u) * 1) 0 0 rgba(0,0,0,.7),
    0 calc(var(--u) * -1) 0 rgba(0,0,0,.7), 0 calc(var(--u) * 1) 0 rgba(0,0,0,.7),
    calc(var(--u) * 1.5) calc(var(--u) * 1.8) calc(var(--u) * 1.2) rgba(0,0,0,.4);
}
.mc-y { color: #ece23e; }
.mc-w { color: #f2f2ef; }
.mc-opt { color: #8b8b8b; }
.mc-opt.is-on { color: #a3d6ff; }

/* grade */
.mc-head { left: calc(var(--u) * 82); top: calc(var(--u) * 47); transition: opacity .3s; }
.mc-h1 { font-size: calc(var(--u) * 21); }
.mc-h2 { font-size: calc(var(--u) * 15); margin-top: calc(var(--u) * 3) !important; }
.mc-name {
  right: calc(var(--u) * 38); top: calc(var(--u) * 34);
  text-align: right; font-size: calc(var(--u) * 21); line-height: calc(var(--u) * 28);
  transition: opacity .3s;
}
.mc-loading { left: 0; width: calc(var(--u) * 682); top: calc(var(--u) * 222); text-align: center; font-size: calc(var(--u) * 22); display: none; }
.mc-screen.is-loading[data-view="grid"] .mc-loading { display: block; }
.mc-screen:is([data-view="detail"], [data-view="confirm"], [data-view="deleting"]) .mc-head { opacity: .45; }
.mc-screen:not([data-view="grid"]) .mc-name { opacity: 0; }

/* tela do dado: coluna de textos centrada em x = 447 */
.mc-panel {
  left: calc(var(--u) * 287); width: calc(var(--u) * 320); top: 0; height: 100%;
  text-align: center;
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.mc-panel > * { position: absolute; left: 0; right: 0; }
.mc-screen:is([data-view="detail"], [data-view="confirm"], [data-view="deleting"]) .mc-panel { opacity: 1; pointer-events: auto; }
.mc-pcard { top: calc(var(--u) * 92); font-size: calc(var(--u) * 19); }
.mc-ptitle { top: calc(var(--u) * 118); font-size: calc(var(--u) * 23); line-height: calc(var(--u) * 30); }
.mc-pdate { top: calc(var(--u) * 184); font-size: calc(var(--u) * 15); }
.mc-psize { top: calc(var(--u) * 206); font-size: calc(var(--u) * 15); }
.mc-menu { top: calc(var(--u) * 254); }
.mc-col { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 12); }
.mc-opt { font-size: calc(var(--u) * 26); padding: calc(var(--u) * 2) calc(var(--u) * 12); }
.mc-act { font-size: calc(var(--u) * 26); padding: calc(var(--u) * 2) 0; }
.mc-ask { font-size: calc(var(--u) * 21); margin-top: calc(var(--u) * 10) !important; }
.mc-msg { font-size: calc(var(--u) * 17); line-height: 1.5; margin-top: calc(var(--u) * 12) !important; }
.mc-yn { display: flex; justify-content: center; gap: calc(var(--u) * 30); margin-top: calc(var(--u) * 6); }
.mc-dim { opacity: .45; }

/* Reset: pergunta no meio da tela, com a grade desfocada atrás */
.mc-dialog { left: 0; width: calc(var(--u) * 682); top: calc(var(--u) * 186); text-align: center; pointer-events: none; }
.mc-dialog:empty { display: none; }
.mc-screen:is([data-view="reset"], [data-view="resetting"]) .mc-dialog { pointer-events: auto; }

/* dicas de botão, embaixo, nos lugares do console */
.mc-hints { left: 0; right: 0; top: calc(var(--u) * 423); height: calc(var(--u) * 20); font-size: calc(var(--u) * 18); }
.mc-hints button { position: absolute; top: 0; display: inline-flex; align-items: center; gap: calc(var(--u) * 6); transform: translateX(-50%); }
.mc-hints button[hidden] { display: none; }
.mc-hint-enter { left: calc(var(--u) * 265); }
.mc-hint-back { left: calc(var(--u) * 386); }
.mc-hint-tri { left: calc(var(--u) * 560); }
.mc-note { left: 0; width: calc(var(--u) * 682); top: calc(var(--u) * 423); text-align: center; font-size: calc(var(--u) * 18); }
.mc-x, .mc-o { display: inline-block; width: calc(var(--u) * 14); height: calc(var(--u) * 14); position: relative; filter: drop-shadow(calc(var(--u) * 1.2) calc(var(--u) * 1.4) 0 rgba(0,0,0,.6)); }
.mc-x::before, .mc-x::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 120%; height: calc(var(--u) * 2.6);
  background: #9db3ff; border-radius: 9px; transform: translate(-50%, -50%) rotate(45deg);
}
.mc-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.mc-o { border: calc(var(--u) * 2.6) solid #ff5d4d; border-radius: 50%; }
.mc-t { width: calc(var(--u) * 16); height: calc(var(--u) * 14); overflow: visible; filter: drop-shadow(calc(var(--u) * 1.2) calc(var(--u) * 1.4) 0 rgba(0,0,0,.6)); }
.mc-t path { fill: none; stroke: #4fd38c; stroke-width: 3; stroke-linejoin: round; }
