/* gfc: Glitchface pop-up chat in the site's own colours. No script and nothing sent: hidden inputs hold the state.
   The chat runs in stages. Each stage offers two suggested messages under the send box; tapping one puts it in
   the box, and the send arrow posts it. He "types" for a moment (three dots), then his reply appears, and the
   next pair of suggestions fades in. The log is bottom-anchored (column-reverse), so the newest message stays in
   view until the reader scrolls up. Each page carries its own opener and stages. */
.gfc { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column-reverse; align-items: flex-end; font-size: 15px; line-height: 1.4; }
.gfc-t { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gfc-fab { display: block; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; border: 2px solid var(--cyan);
  background: #000 url(/blog/img/gf-avatar.webp) center / cover no-repeat; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55); }
.gfc-t:focus-visible ~ .gfc-fab { outline: 2px solid var(--cyan); outline-offset: 3px; }
.gfc-win { display: none; flex-direction: column; width: min(360px, calc(100vw - 36px)); height: min(470px, calc(100vh - 110px)); margin-bottom: 12px;
  border-radius: 14px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.7); }
#gfc-open:checked ~ .gfc-win { display: flex; }
.gfc-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg-2); border-bottom: 1px solid var(--cyan); color: var(--hi); }
.gfc-av { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #000 url(/blog/img/gf-avatar.webp) center / cover no-repeat; }
.gfc-name { flex: 1; font-weight: 700; line-height: 1.15; }
.gfc-name small { display: block; font-weight: 400; font-size: 12px; color: var(--cyan); }
.gfc-min { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; font-size: 20px; font-weight: 700; color: var(--cyan); }
.gfc-min:hover { background: rgba(34, 211, 238, 0.16); }
.gfc-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column-reverse; padding: 12px 12px 8px; }
.gfc-msgs { display: flex; flex-direction: column; gap: 6px; }
.gfc-msgs p { margin: 0; width: fit-content; max-width: 82%; padding: 7px 12px 8px; border-radius: 18px; }
.gfc-him { background: var(--panel); border: 1px solid var(--line); color: var(--body); border-bottom-left-radius: 5px !important; }
.gfc-me { margin-left: auto !important; background: var(--cyan); color: #06060a; font-weight: 600; border-bottom-right-radius: 5px !important; }
.gfc-pair { display: none; }
.gfc-pair p + p { margin-top: 6px; }
.gfc-msgs .gfc-dots { display: flex; gap: 4px; align-items: center; height: 34px; overflow: hidden; animation: gfc-typing 1.5s linear forwards; }
.gfc-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: gfc-bounce 0.9s ease-in-out infinite; }
.gfc-dots i:nth-child(2) { animation-delay: 0.15s; }
.gfc-dots i:nth-child(3) { animation-delay: 0.3s; }
.gfc-msgs .gfc-ans { animation: gfc-arrive 1.8s linear both; }
@keyframes gfc-typing { 0%, 92% { opacity: 1; height: 34px; padding: 7px 12px 8px; margin-top: 6px; border-width: 1px; } 100% { opacity: 0; height: 0; padding: 0 12px; margin-top: 0; border-width: 0; } }
@keyframes gfc-arrive { 0%, 83% { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; border-width: 0; overflow: hidden; } 84% { opacity: 0; max-height: 20em; } 100% { opacity: 1; max-height: 20em; } }
@keyframes gfc-bounce { 0%, 60%, 100% { translate: 0 0; opacity: 0.5; } 30% { translate: 0 -4px; opacity: 1; } }
.gfc-send { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-top: 1px solid var(--line); background: var(--bg-2); }
.gfc-box { flex: 1; min-height: 36px; display: grid; align-items: center; padding: 6px 13px; border-radius: 999px; background: #000; border: 1px solid var(--line); color: var(--hi); }
.gfc-ph { color: var(--muted); }
.gfc-draft, .gfc-box .gfc-done { display: none; }
.gfc-go { flex: none; width: 36px; height: 36px; display: none; place-items: center; border-radius: 50%; background: var(--cyan); color: #06060a; cursor: pointer; font-size: 15px; }
.gfc-go0 { display: grid; background: var(--panel); color: var(--muted); cursor: default; }
.gfc-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 44px; padding: 8px 10px 12px; background: var(--bg-2); }
.gfc-chips label { display: none; padding: 6px 11px; border: 1px solid var(--cyan); border-radius: 999px; color: var(--cyan-lift); cursor: pointer; font-size: 13.5px; animation: gfc-chip 0.5s ease both; }
.gfc-chips label:hover { background: rgba(34, 211, 238, 0.16); }
@keyframes gfc-chip { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
.gfc-win .gfc-c1 { display: inline-block; }
#gfc-sent1:checked ~ .gfc-win .gfc-c1 { display: none; }
#gfc-1a:checked ~ #gfc-sent1:checked ~ .gfc-win .gfc-p1a { display: block; }
#gfc-1a:checked ~ #gfc-sent1:not(:checked) ~ .gfc-win .gfc-d1a { display: block; }
#gfc-1a:checked ~ #gfc-sent1:not(:checked) ~ .gfc-win .gfc-go1 { display: grid; }
#gfc-1a:checked ~ #gfc-sent1:not(:checked) ~ .gfc-win :is(.gfc-ph, .gfc-go0) { display: none; }
#gfc-1a:checked ~ .gfc-win label[for="gfc-1a"] { background: var(--cyan); color: #06060a; }
#gfc-1b:checked ~ #gfc-sent1:checked ~ .gfc-win .gfc-p1b { display: block; }
#gfc-1b:checked ~ #gfc-sent1:not(:checked) ~ .gfc-win .gfc-d1b { display: block; }
#gfc-1b:checked ~ #gfc-sent1:not(:checked) ~ .gfc-win .gfc-go1 { display: grid; }
#gfc-1b:checked ~ #gfc-sent1:not(:checked) ~ .gfc-win :is(.gfc-ph, .gfc-go0) { display: none; }
#gfc-1b:checked ~ .gfc-win label[for="gfc-1b"] { background: var(--cyan); color: #06060a; }
#gfc-sent1:checked ~ .gfc-win .gfc-c2 { display: inline-block; }
#gfc-sent2:checked ~ .gfc-win .gfc-c2 { display: none; }
#gfc-2a:checked ~ #gfc-sent2:checked ~ .gfc-win .gfc-p2a { display: block; }
#gfc-sent1:checked ~ #gfc-2a:checked ~ #gfc-sent2:not(:checked) ~ .gfc-win .gfc-d2a { display: block; }
#gfc-sent1:checked ~ #gfc-2a:checked ~ #gfc-sent2:not(:checked) ~ .gfc-win .gfc-go2 { display: grid; }
#gfc-sent1:checked ~ #gfc-2a:checked ~ #gfc-sent2:not(:checked) ~ .gfc-win :is(.gfc-ph, .gfc-go0) { display: none; }
#gfc-2a:checked ~ .gfc-win label[for="gfc-2a"] { background: var(--cyan); color: #06060a; }
#gfc-2b:checked ~ #gfc-sent2:checked ~ .gfc-win .gfc-p2b { display: block; }
#gfc-sent1:checked ~ #gfc-2b:checked ~ #gfc-sent2:not(:checked) ~ .gfc-win .gfc-d2b { display: block; }
#gfc-sent1:checked ~ #gfc-2b:checked ~ #gfc-sent2:not(:checked) ~ .gfc-win .gfc-go2 { display: grid; }
#gfc-sent1:checked ~ #gfc-2b:checked ~ #gfc-sent2:not(:checked) ~ .gfc-win :is(.gfc-ph, .gfc-go0) { display: none; }
#gfc-2b:checked ~ .gfc-win label[for="gfc-2b"] { background: var(--cyan); color: #06060a; }
#gfc-sent2:checked ~ .gfc-win .gfc-c3 { display: inline-block; }
#gfc-sent3:checked ~ .gfc-win .gfc-c3 { display: none; }
#gfc-3a:checked ~ #gfc-sent3:checked ~ .gfc-win .gfc-p3a { display: block; }
#gfc-sent2:checked ~ #gfc-3a:checked ~ #gfc-sent3:not(:checked) ~ .gfc-win .gfc-d3a { display: block; }
#gfc-sent2:checked ~ #gfc-3a:checked ~ #gfc-sent3:not(:checked) ~ .gfc-win .gfc-go3 { display: grid; }
#gfc-sent2:checked ~ #gfc-3a:checked ~ #gfc-sent3:not(:checked) ~ .gfc-win :is(.gfc-ph, .gfc-go0) { display: none; }
#gfc-3a:checked ~ .gfc-win label[for="gfc-3a"] { background: var(--cyan); color: #06060a; }
#gfc-3b:checked ~ #gfc-sent3:checked ~ .gfc-win .gfc-p3b { display: block; }
#gfc-sent2:checked ~ #gfc-3b:checked ~ #gfc-sent3:not(:checked) ~ .gfc-win .gfc-d3b { display: block; }
#gfc-sent2:checked ~ #gfc-3b:checked ~ #gfc-sent3:not(:checked) ~ .gfc-win .gfc-go3 { display: grid; }
#gfc-sent2:checked ~ #gfc-3b:checked ~ #gfc-sent3:not(:checked) ~ .gfc-win :is(.gfc-ph, .gfc-go0) { display: none; }
#gfc-3b:checked ~ .gfc-win label[for="gfc-3b"] { background: var(--cyan); color: #06060a; }
#gfc-sent3:checked ~ .gfc-win .gfc-c4 { display: inline-block; }
#gfc-sent4:checked ~ .gfc-win .gfc-c4 { display: none; }
#gfc-4a:checked ~ #gfc-sent4:checked ~ .gfc-win .gfc-p4a { display: block; }
#gfc-sent3:checked ~ #gfc-4a:checked ~ #gfc-sent4:not(:checked) ~ .gfc-win .gfc-d4a { display: block; }
#gfc-sent3:checked ~ #gfc-4a:checked ~ #gfc-sent4:not(:checked) ~ .gfc-win .gfc-go4 { display: grid; }
#gfc-sent3:checked ~ #gfc-4a:checked ~ #gfc-sent4:not(:checked) ~ .gfc-win :is(.gfc-ph, .gfc-go0) { display: none; }
#gfc-4a:checked ~ .gfc-win label[for="gfc-4a"] { background: var(--cyan); color: #06060a; }
#gfc-4b:checked ~ #gfc-sent4:checked ~ .gfc-win .gfc-p4b { display: block; }
#gfc-sent3:checked ~ #gfc-4b:checked ~ #gfc-sent4:not(:checked) ~ .gfc-win .gfc-d4b { display: block; }
#gfc-sent3:checked ~ #gfc-4b:checked ~ #gfc-sent4:not(:checked) ~ .gfc-win .gfc-go4 { display: grid; }
#gfc-sent3:checked ~ #gfc-4b:checked ~ #gfc-sent4:not(:checked) ~ .gfc-win :is(.gfc-ph, .gfc-go0) { display: none; }
#gfc-4b:checked ~ .gfc-win label[for="gfc-4b"] { background: var(--cyan); color: #06060a; }
#gfc-sent4:checked ~ .gfc-win .gfc-ph { display: none; }
#gfc-sent4:checked ~ .gfc-win .gfc-box .gfc-done { display: block; }
@media (prefers-reduced-motion: reduce) { .gfc-msgs .gfc-dots { display: none; } .gfc-msgs .gfc-ans, .gfc-chips label { animation: none; } }
@media print { .gfc { display: none; } }

/* roast mode: on a page with no scripted chat yet, he just leaves one comment by his face. Tap his face to hide or show it. */
.gfc-pop { width: fit-content; max-width: min(270px, calc(100vw - 36px)); margin: 0 0 10px; padding: 9px 13px 10px; border-radius: 16px 16px 5px 16px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--body); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); animation: gfc-pop 0.5s ease 1.2s both; }
.gfc-pop b { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--cyan); }
.gfc-roast #gfc-open:checked ~ .gfc-pop { display: none; }
@keyframes gfc-pop { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .gfc-pop { animation: none; } }

/* phones: a smaller window, and the page behind it dims and blurs while the chat is open (gfc-dim) */
@media (max-width: 640px) {
  .gfc { right: 12px; bottom: 12px; font-size: 13.5px; }
  .gfc-fab { width: 46px; height: 46px; }
  .gfc-win { width: min(290px, calc(100vw - 24px)); height: min(400px, calc(100vh - 96px)); margin-bottom: 10px; }
  .gfc-head { padding: 7px 10px; }
  .gfc-av { width: 28px; height: 28px; }
  .gfc-name small { font-size: 11px; }
  .gfc-msgs p { padding: 6px 10px 7px; }
  .gfc-chips label { font-size: 12.5px; padding: 5px 10px; }
  .gfc-box { min-height: 32px; padding: 5px 12px; }
  .gfc-go { width: 32px; height: 32px; }
  .gfc:not(.gfc-roast):has(#gfc-open:checked)::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: rgba(4, 4, 8, 0.6); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
}

/* status line: always smaller than his name, always one line under it */
.gfc .gfc-name { min-width: 0; font-size: 15px; }
.gfc .gfc-name small { display: block; font: 400 11px/1.25 inherit; font-family: inherit; color: var(--cyan); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
