:root {
  --bg: #000;
  --ink: #e9e9e9;
  --pill-bg: rgba(245, 245, 245, 0.92);
  --pill-ink: #111;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; } /* Op. Mobile P4: sem flash cinza do iOS no toque */

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: fixed;
  inset: 0;
  cursor: grab;
}
#app.is-dragging { cursor: grabbing; }
#app.is-hovering { cursor: pointer; }

#app canvas { display: block; }

/* edge fade, like looking into a dark sphere */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0) 14%, rgba(0,0,0,0) 84%, rgba(0,0,0,0.92) 100%),
    radial-gradient(ellipse 85% 75% at 50% 50%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.9) 100%);
}

/* ---------- top bar ---------- */

/* progressive blur band over the gallery, like the reference */
.topblur {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 3;
  pointer-events: none;
  backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 38px;
  padding: 22px 26px 0 30px;
  font-family: "Doto", monospace;
  user-select: none;
}

.brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.14em;
  color: #fff;
  margin-right: auto;
}
.brand span { color: #999; }

.sound {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: #e6e6e6;
  cursor: pointer;
  padding: 4px 0;
}
.sound svg { opacity: 0.55; }

.tagline {
  max-width: 230px;
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.45;
  letter-spacing: 0.08em;
  color: #ddd;
}

.clocks {
  display: grid;
  gap: 5px;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: #cfcfcf;
  white-space: nowrap;
}
.clock b { font-weight: 700; color: #fff; margin-left: 8px; }
.clock i { font-style: normal; color: #8b8b8b; margin-left: 6px; }
.clock-dot { color: #bbb; font-size: 10px; }
.clock:first-child .clock-dot,
.clock:first-child { color: #8f8f8f; }
.clock:first-child b { color: #b5b5b5; }

.talk-pill {
  border: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  background: #fff;
  padding: 17px 30px;
  border-radius: 999px;
  cursor: pointer;
  margin-top: -4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease;
}
.talk-pill:hover { transform: scale(1.04); }

/* pill "voltar ao site" (modo embedded e standalone) */
.close-site {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(18, 18, 18, 0.7);
  backdrop-filter: blur(12px);
  color: #eee;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 16px 24px;
  border-radius: 999px;
  cursor: pointer;
  margin-top: -4px;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.close-site span { font-size: 12px; opacity: 0.7; }
.close-site:hover { background: rgba(35, 35, 35, 0.85); border-color: rgba(255, 255, 255, 0.4); }

@media (max-width: 1100px) {
  .tagline, .sound { display: none; }
}
@media (max-width: 760px) {
  .clocks { display: none; }

  /* Op. Mobile v13: no iPhone (390px) os flutuantes cortavam/colidiam
     (print pendencias/02). Topbar compacta + "Voltar ao site" vira ícone;
     barra inferior em 2 níveis (nav acima, cantos abaixo) → zero colisão. */
  .topbar {
    gap: 12px;
    padding: 16px 14px 0 16px;
    align-items: center;
  }
  .brand { font-size: 16px; }
  .talk-pill {
    font-size: 13px;
    padding: 11px 18px;
    margin-top: 0;
  }
  .close-site {
    padding: 11px 12px;      /* botão-ícone: só o ✕ */
    gap: 0;
    margin-top: 0;
  }
  .close-site .close-site-label { display: none; }
  .close-site span { font-size: 14px; opacity: 0.85; }
}

/* ---------- bottom UI ---------- */

.nav-pill {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(190, 190, 190, 0.45);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.nav-item {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #16161a;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.35); }
.nav-item.is-active { background: #fff; font-weight: 600; }

.filter-pill {
  position: fixed;
  right: 26px;
  bottom: 22px;
  z-index: 5;
  border: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--pill-ink);
  background: var(--pill-bg);
  backdrop-filter: blur(12px);
  padding: 16px 28px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease;
}
.filter-pill:hover { transform: translateY(-2px); }

.view-toggles {
  position: fixed;
  left: 26px;
  bottom: 22px;
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(22, 22, 22, 0.85);
  backdrop-filter: blur(12px);
}
.toggle {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: #888;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.toggle:hover { background: #2a2a2a; color: #fff; }
.toggle.is-active { background: #fff; color: #111; }

/* Op. Mobile v13: barra inferior em 2 níveis no iPhone (nav sobe, cantos abaixo)
   → sem colisão. (Precisa vir DEPOIS das bases .nav-pill/.view-toggles/.filter-pill:
   mesma especificidade, a última regra na fonte vence.) */
@media (max-width: 760px) {
  .nav-pill {
    bottom: 78px;
    gap: 2px;
    padding: 4px;
  }
  .nav-item { font-size: 14px; padding: 10px 16px; }
  .view-toggles { left: 16px; bottom: 20px; }
  .filter-pill {
    right: 16px;
    bottom: 20px;
    font-size: 14px;
    padding: 13px 22px;
  }
}

/* ---------- detail page ---------- */

.detail {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #050505;
  clip-path: inset(100% 0 0 0);
  visibility: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 30px 40px 120px;
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 70px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px; /* Op. Mobile P2: alvo de toque mínimo Apple */
  border: 1px solid #2c2c2c;
  background: transparent;
  color: #ddd;
  font-family: inherit;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.back-btn:hover { background: #161616; border-color: #444; }

.detail-client {
  font-family: "Doto", monospace;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.18em;
  color: #9a9a9a;
  text-transform: uppercase;
}

.detail-title {
  font-size: clamp(44px, 7.5vw, 96px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.98;
  text-transform: uppercase;
  max-width: 14ch;
}

.detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 38px 0 26px;
}

.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-tags span {
  font-family: "Doto", monospace;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #cfcfcf;
  background: #1a1a1a;
  border-radius: 999px;
  padding: 9px 16px;
  text-transform: uppercase;
}

.detail-year {
  font-family: "Doto", monospace;
  font-weight: 600;
  font-size: 14px;
  color: #8d8d8d;
}

/* Honestidade comercial: entrega real do Jordi vs referência de estilo.
   Op. Mobile v13: laranja removido — a diferença ficou SUAVE (o laranja destoava
   demais). Referência = contorno discreto; .is-real = pílula clara fosca. */
.detail-status {
  font-family: "Doto", monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 8px 15px;
  color: #b0b0b0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}
.detail-status.is-real {
  color: #f2f2f2;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.30);
}

.detail-hero {
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111;
}
.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* print inteiro, sem corte — mesma filosofia dos tiles */
  display: block;
}
.detail-hero-2 { margin-top: 18px; }

.detail-body {
  margin-top: 64px;
  columns: 2;
  column-gap: 48px;
  color: #b9b9b9;
  font-size: 16px;
  line-height: 1.65;
}
.detail-body p { break-inside: avoid; margin-bottom: 18px; }

@media (max-width: 760px) {
  .detail-body { columns: 1; }
  .detail-inner { padding: 22px 22px 90px; }
}

/* ---------- fallback acessível (F2.4) — fora da tela; aparece no foco ---------- */

.a11y-projects {
  position: fixed;
  left: -9999px;
  top: 92px;
  z-index: 40;
}
.a11y-projects:focus-within {
  left: 16px;
  background: rgba(8, 8, 8, 0.96);
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 12px 16px;
  max-height: 70vh;
  overflow-y: auto;
}
.a11y-hint {
  margin: 0 0 8px;
  font: 600 11px "Doto", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9a9a9a;
}
.a11y-projects ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.a11y-projects button {
  background: none;
  border: 0;
  color: #cfcfcf;
  font: 500 13px "Inter", sans-serif;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  text-align: left;
  width: 100%;
}
.a11y-projects button:hover { color: #fff; background: #1a1a1a; }
.a11y-projects button:focus-visible { outline: 2px solid #f97015; color: #fff; }

/* ---------- loader ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #000;
  display: grid;
  place-content: center;
  gap: 22px;
}
.loader-word {
  font-family: "Doto", monospace;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.18em;
  color: #fff;
  text-align: center;
}
.loader-word span { color: #777; }
.loader-bar {
  width: 180px;
  height: 2px;
  background: #1d1d1d;
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}
.loader-fill {
  width: 0%;
  height: 100%;
  background: #fff;
}
