/* João Pinho — site patch 1.4.0 */
:root {
  --jp-h-bg: #0b0c10;
  --jp-h-fg: #eeeae1;
  --jp-h-muted: #a8a69f;
  --jp-h-acid: #b9ff38;
  --jp-h-violet: #8780ff;
  --jp-h-line: rgba(238,234,225,.26);
}

/* The popup replaces the raw comment/contact residue on the redesigned home. */
body.home #comments,
body.home .comments-area,
body.home #respond,
body.home .comment-respond,
body.home .wp-block-post-comments-form,
body.home iframe[name="jetpack_remote_comment"] { display: none !important; }

.jp-human-trigger {
  position: fixed;
  z-index: 99980;
  right: clamp(12px, 2vw, 28px);
  bottom: clamp(12px, 2vw, 28px);
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  max-width: calc(100vw - 24px);
  padding: .68rem .82rem;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 2px;
  background: rgba(11,12,16,.92);
  color: var(--jp-h-fg);
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font: 600 11px/1.15 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .055em;
  text-transform: lowercase;
  cursor: pointer;
  transform: translateZ(0);
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.jp-human-trigger:hover,
.jp-human-trigger:focus-visible { border-color: var(--jp-h-acid); background: var(--jp-h-bg); transform: translateY(-2px); }
.jp-human-trigger__box {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--jp-h-acid);
  color: var(--jp-h-acid);
  font-size: 12px;
}

.jp-human-modal[hidden] { display: none !important; }
.jp-human-modal {
  position: fixed;
  z-index: 99990;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}
.jp-human-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,3,5,.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.jp-human-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  overflow: auto;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid var(--jp-h-line);
  border-top: 3px solid var(--jp-h-acid);
  background:
    linear-gradient(90deg, transparent 0 49.7%, rgba(255,255,255,.025) 49.8% 50.2%, transparent 50.3%),
    var(--jp-h-bg);
  color: var(--jp-h-fg);
  box-shadow: 0 30px 100px rgba(0,0,0,.48);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  animation: jpHumanIn .22s cubic-bezier(.2,.8,.2,1) both;
}
.jp-human-card::before {
  content: "!!!((()))!!!   ∴   / / /   ➰";
  position: absolute;
  top: 9px;
  left: 12px;
  color: rgba(238,234,225,.26);
  font-size: 9px;
  letter-spacing: .12em;
  pointer-events: none;
}
.jp-human-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--jp-h-fg);
  font: 400 28px/1 monospace;
  cursor: pointer;
}
.jp-human-kicker { margin-top: 10px; color: var(--jp-h-acid); font-size: 10px; letter-spacing: .16em; }
.jp-human-card h2 { margin: .7rem 0 .45rem; color: var(--jp-h-fg); font: 500 clamp(31px, 7vw, 58px)/.88 Georgia, 'Times New Roman', serif; letter-spacing: -.045em; }
.jp-human-intro { margin: 0 0 1.5rem; color: var(--jp-h-muted); font-size: 12px; }

.jp-human-check {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  margin: 0 0 1.35rem;
  padding: 15px;
  border: 1px solid var(--jp-h-line);
  background: rgba(255,255,255,.025);
}
.jp-human-check__mark {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(238,234,225,.58);
  position: relative;
  transition: border-color .18s ease, background .18s ease;
}
.jp-human-check.is-valid .jp-human-check__mark { border-color: var(--jp-h-acid); background: var(--jp-h-acid); }
.jp-human-check.is-valid .jp-human-check__mark::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--jp-h-bg);
  font-weight: 900;
}
.jp-human-check label { display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.jp-human-challenge { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.jp-human-challenge input {
  width: 62px;
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid var(--jp-h-fg);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--jp-h-fg);
  font: inherit;
  text-align: center;
}
.jp-human-check small { display: block; margin-top: 6px; color: var(--jp-h-muted); font-size: 9px; }

.jp-human-fields { display: grid; gap: 14px; }
.jp-human-fields label { display: grid; gap: 6px; color: var(--jp-h-muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.jp-human-fields input,
.jp-human-fields textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--jp-h-line);
  border-radius: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  color: var(--jp-h-fg);
  font: 400 15px/1.45 Georgia, 'Times New Roman', serif;
}
.jp-human-fields input:focus,
.jp-human-fields textarea:focus { border-bottom-color: var(--jp-h-acid); }
.jp-human-hp { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.jp-human-submit {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  padding: 13px 14px;
  border: 1px solid var(--jp-h-acid);
  background: transparent;
  color: var(--jp-h-acid);
  font: 600 11px/1 monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
.jp-human-submit:hover,
.jp-human-submit:focus-visible { background: var(--jp-h-acid); color: var(--jp-h-bg); }
.jp-human-submit[disabled] { opacity: .5; cursor: progress; }
.jp-human-status { min-height: 1.4em; margin: 10px 0 0; color: var(--jp-h-muted); font-size: 10px; }
.jp-human-status.is-ok { color: var(--jp-h-acid); }
.jp-human-status.is-error { color: #ff9b8f; }
.jp-human-meta { margin-top: 20px; padding-top: 10px; border-top: 1px dashed rgba(238,234,225,.15); color: rgba(238,234,225,.3); font-size: 8px; letter-spacing: .07em; }
body.jp-human-open { overflow: hidden; }

/* Small, safe rendering hints for the horizontal archive. JS adds this class only
   to the detected "Arquivo Vivo" scroller. */
.jp-archive-optimized { contain: layout style; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.jp-archive-optimized img { content-visibility: auto; contain-intrinsic-size: 320px 420px; }
.jp-archive-optimized.jp-is-dragging { cursor: grabbing !important; user-select: none; }

@keyframes jpHumanIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 560px) {
  .jp-human-trigger { font-size: 10px; }
  .jp-human-card { padding: 30px 22px 24px; }
  .jp-human-check { grid-template-columns: 36px 1fr; padding: 12px; }
  .jp-human-check__mark { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .jp-human-card { animation: none; }
  .jp-human-trigger, .jp-human-check__mark { transition: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* v1.4.0 — genuine historical text fragments interleaved with the image stream. */
.jp-old-fragment {
  box-sizing: border-box;
  flex: 0 0 clamp(230px, 26vw, 360px);
  min-height: clamp(300px, 42vw, 480px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.4rem;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgba(238,234,225,.2);
  background: linear-gradient(145deg, rgba(255,255,255,.025), transparent 60%), #0b0c10;
  color: #eeeae1;
  text-decoration: none;
  scroll-snap-align: start;
  content-visibility: auto;
  contain-intrinsic-size: 300px 420px;
}
.jp-old-fragment:hover,
.jp-old-fragment:focus-visible { border-color: #b9ff38; }
.jp-old-fragment__code {
  font: 600 9px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .11em;
  color: #b9ff38;
}
.jp-old-fragment__text {
  max-width: 16ch;
  font: 400 clamp(24px, 3.5vw, 46px)/.96 Georgia, 'Times New Roman', serif;
  letter-spacing: -.035em;
}
.jp-old-fragment__meta {
  font: 500 9px/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: rgba(238,234,225,.55);
}
@media (max-width: 560px) {
  .jp-old-fragment { flex-basis: 76vw; min-height: 360px; }
}

/* v1.4.1 — controlled glitch: short bursts only while the archive moves. */
.jp-glitch-card { position: relative; isolation: isolate; }
.jp-glitch-card::after {
  content: '!!!((()))!!!  ∴  CURVING_LOOP  //  ░▒▓';
  position: absolute;
  z-index: 8;
  inset: 8% -2% auto 3%;
  padding: 3px 5px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  color: #b9ff38;
  background: rgba(8,9,12,.82);
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .14em;
  white-space: nowrap;
  mix-blend-mode: screen;
}
.jp-glitch-card.jp-glitch-hit::after { animation: jpArchiveSignal 300ms steps(2, end) both; }
.jp-glitch-card.jp-glitch-hit img { animation: jpArchiveImageGlitch 300ms steps(2, end) both; }
.jp-old-fragment.jp-glitch-hit .jp-old-fragment__text { animation: jpArchiveTextGlitch 300ms steps(2, end) both; }

@keyframes jpArchiveSignal {
  0%   { opacity: 0; transform: translate(0,0) skewX(0); clip-path: inset(0 0 70% 0); }
  18%  { opacity: .95; transform: translate(-7px,3px) skewX(-12deg); clip-path: inset(8% 0 45% 0); }
  42%  { opacity: .3; transform: translate(9px,-2px) skewX(8deg); clip-path: inset(55% 0 12% 0); }
  66%  { opacity: .85; transform: translate(-3px,5px) skewX(-4deg); clip-path: inset(30% 0 35% 0); }
  100% { opacity: 0; transform: translate(0,0); clip-path: inset(0); }
}
@keyframes jpArchiveImageGlitch {
  0%,100% { transform: translate3d(0,0,0); filter: none; }
  22% { transform: translate3d(-5px,1px,0) skewX(-1deg); filter: contrast(1.28) saturate(.65); }
  48% { transform: translate3d(5px,-1px,0) skewX(1deg); filter: contrast(1.5) saturate(1.3); }
  72% { transform: translate3d(-2px,0,0); filter: contrast(1.15); }
}
@keyframes jpArchiveTextGlitch {
  0%,100% { transform: translate(0); text-shadow: none; }
  25% { transform: translate(-4px,1px) skewX(-2deg); text-shadow: 5px 0 0 rgba(185,255,56,.45); }
  55% { transform: translate(4px,-1px) skewX(2deg); text-shadow: -5px 0 0 rgba(238,234,225,.25); }
}
@media (prefers-reduced-motion: reduce) {
  .jp-glitch-card::after { display: none !important; }
  .jp-glitch-card.jp-glitch-hit img,
  .jp-old-fragment.jp-glitch-hit .jp-old-fragment__text { animation: none !important; }
}

/* v1.5.0 — deliberately quiet bilingual switch. */
.jp-lang-switch {
  position: fixed;
  z-index: 99980;
  top: 18px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(238,234,225,.16);
  background: rgba(9,10,13,.72);
  color: rgba(238,234,225,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font: 650 9px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.jp-lang-switch a {
  color: inherit;
  text-decoration: none;
  transition: color .16s ease, opacity .16s ease;
}
.jp-lang-switch a:hover,
.jp-lang-switch a:focus-visible,
.jp-lang-switch a[aria-current="page"] { color: #b9ff38; }
.jp-lang-switch a:not([aria-current="page"]) { opacity: .72; }
body.admin-bar .jp-lang-switch { top: 50px; }
@media (max-width: 560px) {
  .jp-lang-switch { top: 12px; right: 12px; padding: 5px 7px; font-size: 8px; }
  body.admin-bar .jp-lang-switch { top: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  .jp-lang-switch a { transition: none; }
}

/* v1.6.1 — Living Archive reading / image expansion layer. */
.jp-archive-image-card,
.jp-old-fragment { cursor: zoom-in; }

.jp-archive-modal[hidden] { display: none !important; }
.jp-archive-modal {
  position: fixed;
  z-index: 100020;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 34px);
  color: #eeeae1;
}
.jp-archive-modal__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(185,255,56,.045), transparent 35%),
    rgba(5,6,8,.91);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
}
.jp-archive-modal__panel {
  position: relative;
  z-index: 1;
  width: min(1180px, 96vw);
  height: min(860px, 92vh);
  border: 1px solid rgba(238,234,225,.18);
  background: rgba(9,10,13,.975);
  box-shadow: 0 28px 90px rgba(0,0,0,.55);
  overflow: hidden;
}
.jp-archive-modal__panel::before {
  content: 'ARQ_U_I_VO // EXPAND // ∴ // !!!((()))!!!';
  position: absolute;
  z-index: 3;
  left: 18px;
  top: 15px;
  max-width: calc(100% - 110px);
  overflow: hidden;
  color: rgba(185,255,56,.72);
  font: 650 8px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .15em;
  white-space: nowrap;
  pointer-events: none;
}
.jp-archive-modal__close {
  position: absolute;
  z-index: 8;
  top: 9px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #eeeae1;
  font: 300 30px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  cursor: pointer;
}
.jp-archive-modal__close:hover,
.jp-archive-modal__close:focus-visible { color: #b9ff38; }
.jp-archive-modal__stage {
  position: absolute;
  inset: 48px 54px 22px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(185,255,56,.52) transparent;
}
.jp-archive-modal__image-wrap {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: auto;
}
.jp-archive-modal__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform .22s ease, filter .22s ease;
}
.jp-archive-modal__image.is-zoomed {
  max-width: none;
  max-height: none;
  transform: scale(1.55);
  cursor: zoom-out;
}
.jp-archive-modal__image-index {
  position: absolute;
  right: 10px;
  bottom: 7px;
  padding: 4px 6px;
  background: rgba(9,10,13,.72);
  color: #b9ff38;
  font: 600 8px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .12em;
}
.jp-archive-modal__nav {
  position: absolute;
  z-index: 6;
  top: 50%;
  width: 42px;
  height: 58px;
  margin-top: -29px;
  border: 0;
  background: transparent;
  color: rgba(238,234,225,.58);
  font: 300 30px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  cursor: pointer;
}
.jp-archive-modal__nav:hover,
.jp-archive-modal__nav:focus-visible { color: #b9ff38; }
.jp-archive-modal__nav--prev { left: 6px; }
.jp-archive-modal__nav--next { right: 6px; }
.jp-archive-modal__poem {
  box-sizing: border-box;
  width: min(760px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 62px) clamp(10px, 4vw, 46px) 72px;
}
.jp-archive-modal__signal {
  margin-bottom: 22px;
  color: #b9ff38;
  font: 650 8px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .14em;
}
.jp-archive-modal__title {
  margin: 0 0 8px;
  color: #eeeae1;
  font: 400 clamp(30px, 5.4vw, 62px)/.94 Georgia, 'Times New Roman', serif;
  letter-spacing: -.04em;
}
.jp-archive-modal__date {
  margin-bottom: clamp(28px, 5vw, 54px);
  color: rgba(238,234,225,.42);
  font: 600 9px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .11em;
}
.jp-archive-modal__body {
  color: #eeeae1;
  font: 400 clamp(18px, 2vw, 23px)/1.58 Georgia, 'Times New Roman', serif;
}
.jp-archive-modal__body p { margin: 0 0 1.25em; }
.jp-archive-modal__body img,
.jp-archive-modal__body figure,
.jp-archive-modal__body iframe { max-width: 100%; height: auto; }
.jp-archive-modal__body a { color: #b9ff38; text-underline-offset: 3px; }
.jp-archive-modal__permalink {
  display: inline-block;
  margin-top: 28px;
  color: rgba(238,234,225,.48);
  font: 600 9px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}
.jp-archive-modal__permalink:hover,
.jp-archive-modal__permalink:focus-visible { color: #b9ff38; }
body.jp-archive-open { overflow: hidden; }

@media (max-width: 680px) {
  .jp-archive-modal { padding: 7px; }
  .jp-archive-modal__panel { width: 100%; height: 96vh; }
  .jp-archive-modal__stage { inset: 46px 34px 14px; }
  .jp-archive-modal__nav { width: 32px; }
  .jp-archive-modal__nav--prev { left: 0; }
  .jp-archive-modal__nav--next { right: 0; }
  .jp-archive-modal__poem { padding-left: 7px; padding-right: 7px; }
  .jp-archive-modal__image.is-zoomed { transform: scale(1.25); }
}
@media (prefers-reduced-motion: reduce) {
  .jp-archive-modal__image { transition: none; }
}

/* v1.7.1 — direct archive-image interaction, independent from theme wrappers. */
.jp-archive-clickable-image { cursor: zoom-in !important; }
.jp-static-fragment { cursor: pointer; }


/* 1.8.0 — explicit, non-invasive image expand control. */
.jp-archive-image-card { position: relative !important; }
.jp-image-expand {
  position: absolute !important;
  right: 10px !important;
  bottom: 10px !important;
  z-index: 60 !important;
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  border: 1px solid currentColor !important;
  border-radius: 50% !important;
  background: rgba(245,245,240,.9) !important;
  color: #111 !important;
  text-decoration: none !important;
  font: 600 18px/1 system-ui,sans-serif !important;
  cursor: zoom-in !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.jp-image-expand:hover,.jp-image-expand:focus-visible { transform: rotate(12deg) scale(1.06); }
@media (hover:hover) {
  .jp-image-expand { opacity:.76; transition:opacity .18s ease,transform .18s ease; }
  .jp-archive-image-card:hover .jp-image-expand { opacity:1; }
}

/* 1.9.0 — DOM-confirmed: Arquivo Vivo images are CSS backgrounds on .image-stage. */
.image-stage.jp-archive-image-card { cursor: zoom-in !important; }
.image-stage.jp-archive-image-card:focus-visible { outline: 1px solid #b9ff38 !important; outline-offset: 3px; }
