/* ==========================================================
   We All Float Down Here · Aqui embaixo todo mundo flutua
   The essay's own face over the house template (ensaio.css): the hero loop, the fifth mode,
   the Opening and the Closing as free sections, Mike's notebook in Interlude I, the mock banner.
   Colors come from the :root tokens of ensaio.css; build_it.py measures every text pair.
   ========================================================== */

:root {
  /* Mike's notebook: lined paper and typewriter ink (Interlude I) */
  --papel: #e9e2d0;
  --papel-linha: rgba(52, 72, 98, 0.16);
  --tinta: #1f2a36;
  --tinta-suave: #4f4a3e;
  --tinta-data: #6b2a1f;
}

/* the fifth mode: the notebook, from Part V to the footer */
body[data-modo-ativo="5"] { --m1: var(--modo-5a); --m2: var(--modo-5b); }

/* ---------- HERO: the Firefly loop over its still ---------- */
/* the video sits over the still, visible from the start: its poster is the same picture */
.hero-arte video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) { .hero-arte video { display: none; } }
/* until the Firefly art arrives, the mock shows a wet street drawn in gradients */
.hero.sem-arte .hero-arte {
  background:
    radial-gradient(ellipse 42% 30% at 78% 82%, rgba(255, 138, 61, 0.16), transparent 70%),
    linear-gradient(170deg, #1b2430 0%, #0f141b 55%, #07090c 100%);
}

/* ---------- liquid glass (Juliana, 16/11/2026: "deixaria a UI mais liquid glass") ----------
   The controls and frames are glass over the rain: the bar, the hero's title panel, the spoiler
   notice, the pieces (interativo 'instrumento'), the next-chapter card, the closing panel and the bio.
   The reading column stays on a stable ground. With vidroLiquido, ensaio.js marks these panes
   .refract and efeitos/liquid-glass.js bends their rims (Chromium only, never with reduced
   transparency; elsewhere the plain frost stays). */
.portao .spoiler, html[data-hero="pintura-cheia"] .hero-texto, .proximo a, .fecho-ensaio {
  background: var(--vidro); border: 1px solid var(--vidro-borda);
  -webkit-backdrop-filter: blur(var(--vidro-blur)) saturate(1.25); backdrop-filter: blur(var(--vidro-blur)) saturate(1.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.32);
}
/* the hero panel is a lighter frost than the other panes (Juliana, 16/11/2026: "menos blurry levemente pra
   ficar mais facil de ver o video, mas ainda focando no texto"): 8 px of blur instead of 16, a little less
   tint; the title lines pass AA over the bare video even without the panel (qa/verificar_mock.cjs) */
html[data-hero="pintura-cheia"] .hero-texto {
  padding: 1.8rem 2rem 2rem; border-radius: var(--raio-grande); background: color-mix(in srgb, var(--fundo) 30%, transparent);
  -webkit-backdrop-filter: blur(8px) saturate(1.25); backdrop-filter: blur(8px) saturate(1.25);
}
.portao .spoiler { border-radius: var(--raio-grande); padding: 1rem 1.3rem; }
.proximo a { background: var(--vidro); }
.fecho-ensaio { max-width: 760px; margin: 2rem auto 3rem; padding: 2.4rem 2rem; border-radius: var(--raio-grande); }
@media (max-width: 560px) {
  /* on a phone the panel holds most of the screen: a lighter glass, so the rain shows through it */
  html[data-hero="pintura-cheia"] .hero-texto {
    padding: 1.2rem 1.1rem 1.4rem; background: color-mix(in srgb, var(--fundo) 14%, transparent);
    -webkit-backdrop-filter: blur(4px) saturate(1.2); backdrop-filter: blur(4px) saturate(1.2);
  }
  .fecho-ensaio { margin-inline: var(--margem); padding: 1.8rem 1.2rem; }
}
@media (prefers-reduced-transparency: reduce) {
  .portao .spoiler, html[data-hero="pintura-cheia"] .hero-texto, .proximo a, .fecho-ensaio {
    background: var(--painel) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
}

/* the cursor: the glass lens of Intersexo 2 (cursor 'lente', Juliana 16/11/2026), in this essay's glass:
   a light on its upper rim, and the slicker's yellow on its ring over anything that can be pressed.
   Mouse only; it hides over the pieces' stages, on touch, in print and with reduced motion. */
.cursor-lente {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 14px rgba(0, 0, 0, 0.35);
  /* clear glass everywhere: the house lens had a 2 px blur that put the text under it out of focus */
  -webkit-backdrop-filter: saturate(1.25) brightness(1.06); backdrop-filter: saturate(1.25) brightness(1.06);
}
/* it stays inside the pieces too: the house hides it over the stages while the system cursor stays
   hidden, which left the stages with no cursor at all (Juliana, 16/11/2026) */
.cursor-lente.is-oculta { opacity: 1; }
/* no system text cursor over the prose: the lens is the only pointer (Juliana, 16/11/2026) */
/* over a control the lens is clear glass: no blur, so the label under it stays readable */
.cursor-lente.is-alvo {
  border-color: color-mix(in srgb, var(--acento) 75%, transparent); background: color-mix(in srgb, var(--titulo) 4%, transparent);
  -webkit-backdrop-filter: saturate(1.25) brightness(1.06); backdrop-filter: saturate(1.25) brightness(1.06);
}
/* the reading glass (it.js, part 3; Juliana, 16/11/2026: "deixasse o texto meio iluminado e aumentasse
   levemente de tamanho"). Over the reading text the lens grows and holds a sharp copy of the words under
   it, 1.2 times larger and lit, with a soft yellow light in the glass; a frosted, darker ground keeps the
   original line behind the copy from showing through. In Mike's notebook the glass is paper and the ink
   stays ink. A link inside the text keeps the yellow ring. */
.cursor-lente .lupa-miolo { display: none; }
.cursor-lente.is-lupa {
  width: 92px; height: 92px; margin: -46px 0 0 -46px; overflow: hidden;
  border-color: color-mix(in srgb, var(--titulo) 34%, transparent);
  background:
    radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--acento) 12%, transparent), transparent 72%),
    color-mix(in srgb, var(--fundo) 82%, transparent);
  -webkit-backdrop-filter: blur(6px) brightness(1.08); backdrop-filter: blur(6px) brightness(1.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 16px rgba(0, 0, 0, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.45), 0 0 22px color-mix(in srgb, var(--acento) 14%, transparent);
}
.cursor-lente.is-lupa.is-alvo { border-color: color-mix(in srgb, var(--acento) 80%, transparent); }
.cursor-lente.is-lupa .lupa-miolo { display: block; position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.lupa-miolo > * { color: var(--titulo); text-shadow: 0 0 10px color-mix(in srgb, var(--titulo) 38%, transparent); }
.lupa-miolo a { color: inherit; text-decoration-color: var(--acento); text-underline-offset: 3px; }
.cursor-lente.is-lupa.is-papel {
  border-color: rgba(31, 42, 54, 0.35);
  background: radial-gradient(circle at 50% 44%, #fffaf0, transparent 75%), color-mix(in srgb, var(--papel) 94%, transparent);
}
.cursor-lente.is-papel .lupa-miolo > * { color: var(--tinta); text-shadow: none; }

/* ---------- the reading ground: the gutter from above, a Firefly loop (it.js part 4) ----------
   Chosen by Juliana on 16/11/2026 over the house scene and two paintings. The house veil (.fundo-camada)
   stays over it, so the reading column keeps its ground. It fades in once the reader leaves the hero. */
.it-fundo { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 1.4s ease;
  background-size: cover; background-position: center; }
.it-fundo.is-ligado { opacity: 1; }
.it-fundo-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.it-fundo, .it-fundo-video { filter: brightness(0.72) saturate(0.9); }
.it-fundo .it-fundo-video { filter: none; }   /* the layer already dims the still and the video together */
/* the block's colour over the picture, as the essay moves from rain grey to the notebook's paper */
.it-fundo-tinta { position: absolute; inset: 0; background: color-mix(in srgb, var(--m1) 22%, transparent); mix-blend-mode: soft-light; transition: background-color 1.2s ease; }

/* ---------- the Opening and the Closing: sections of their own, laid out like a chapter ---------- */
.capitulo-livre {
  position: relative;
  display: grid; grid-template-columns: minmax(var(--margem), 1fr) minmax(0, var(--coluna)) minmax(var(--margem), 1fr);
  padding: 4.5rem 0 3rem;
}
.capitulo-livre > * { grid-column: 2; }
.capitulo-livre .capitulo-titulo { font-family: var(--fonte-titulo); font-size: var(--t-xl); margin-bottom: 1.6rem; }
.capitulo-livre .capitulo-rotulo { font-family: var(--fonte-mono); font-size: var(--t-xs); letter-spacing: 0.22em; text-transform: uppercase; color: var(--acento); margin-bottom: 0.6rem; }

/* the spoiler notice sits in the reading column, before the Opening */
.portao { max-width: var(--coluna); margin: 0 auto; padding: 3.5rem var(--margem) 0; }
.portao .spoiler strong { color: var(--titulo); font-weight: 600; }

/* the essay's last line, after the Closing */
.fecho-ensaio { padding-top: 1rem; padding-bottom: 3rem; }

/* ---------- Interlude I: Mike's notebook ---------- */
.cronica {
  position: relative; margin: 1.2rem 0 0; padding: 2.2rem clamp(1.1rem, 0.6rem + 2.4vw, 2.6rem) 2.4rem;
  border-radius: 6px; color: var(--tinta); font-family: var(--fonte-mono); font-size: calc(var(--t-base) * 0.94); line-height: 1.75;
  background-color: var(--papel);
  background-image:
    linear-gradient(90deg, transparent 2.2rem, rgba(176, 52, 48, 0.28) 2.2rem, rgba(176, 52, 48, 0.28) calc(2.2rem + 1px), transparent calc(2.2rem + 1px)),
    repeating-linear-gradient(180deg, transparent 0, transparent calc(1.75em - 1px), var(--papel-linha) calc(1.75em - 1px), var(--papel-linha) 1.75em);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 24px 60px rgba(0, 0, 0, 0.45);
}
.cronica p { max-width: var(--medida); }
.cronica p + p { margin-top: 1.1em; }
.cronica .cronica-nota { font-style: italic; color: var(--tinta-suave); }
.cronica .cronica-nota em { font-style: normal; }
.cronica .cronica-data { color: var(--tinta-data); font-weight: 700; letter-spacing: 0.02em; }
.cronica .cronica-refrao { font-style: italic; color: var(--tinta-suave); }
.cronica .cronica-fecho { font-style: italic; color: var(--tinta); margin-top: 1.6em; }
.cronica a { color: inherit; }

/* ---------- the mock banner ---------- */
.mock-faixa {
  max-width: var(--coluna); margin: 1.4rem auto 0; padding: 0.55rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--acento) 70%, transparent); border-radius: var(--raio);
  font-family: var(--fonte-mono); font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--acento); text-align: center;
}

/* an interactive that is still being made (--figuras-pendentes): a marked place, never counted */
.interativo-pendente {
  margin: 2.4rem 0; padding: 1.6rem 1.2rem; border: 1px dashed var(--linha-2); border-radius: var(--raio);
  font-family: var(--fonte-mono); font-size: var(--t-xs); letter-spacing: 0.06em; color: var(--fraco); text-align: center;
}

@media print {
  .hero-arte video, .interativo-pendente, .mock-faixa, .it-fundo { display: none !important; }
  .portao .spoiler, .hero-texto, .proximo a, .fecho-ensaio { background: none !important; box-shadow: none !important; border-color: #999 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .cronica { background: #fff !important; box-shadow: none !important; color: #000 !important; border: 1px solid #999; }
  .cronica .cronica-nota, .cronica .cronica-refrao, .cronica .cronica-data { color: #000 !important; }
}
