/* ---------------------------------------------------------------------------
   Shared chrome for the long-form case studies.

   Two jobs: the deterrents against casual copying, and the watermark. Read the
   comment on .watermark before assuming any of this stops a determined person —
   it does not, and it cannot.
   --------------------------------------------------------------------------- */

/* ---- selection ----
   Text cannot be swiped, and the long-press callout on iOS does not appear.
   This does not affect screen readers, which read the accessibility tree
   rather than the selection. */
html {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Images and the SVG diagrams cannot be dragged out to the desktop or into
   another tab, which is the single easiest way to lift one. */
img,
svg,
figure {
  -webkit-user-drag: none;
  user-drag: none;
}

/* ---- watermark ----
   The only measure here that survives a screenshot.

   Nothing in a browser can stop a screen capture: the operating system reads
   the framebuffer and the page is never told. Blurring the page on `blur` or
   `visibilitychange` is the usual suggestion and it is theatre — PrintScreen on
   Windows and Cmd-Shift-4 on macOS fire neither event, so the trick catches no
   one while punishing every reader who switches tabs.

   So the goal shifts from prevention to attribution: a capture of this page
   carries the author's domain across it, which is what makes a lifted
   screenshot useless as someone else's work. Kept faint enough to read
   through, strong enough to survive a JPEG. */
.watermark {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.055;
}

/* ---- the copy notice ----
   Shown when someone tries to copy, save or print. A refusal with no
   explanation reads as a broken page. */
.notice {
  position: fixed;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 1rem);
  z-index: 10000;
  max-width: min(90vw, 30rem);
  padding: 0.8rem 1.1rem;
  background: #16161c;
  border: 1px solid #2b2b33;
  border-radius: 4px;
  color: #c3c8d2;
  font: 400 12px/1.5 "IBM Plex Mono", ui-monospace, Consolas, monospace;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.notice[data-show="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .notice { transition: none; }
}

/* ---- site chrome on the page ---- */
.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  max-width: calc(var(--measure, 68ch) + var(--gutter, 9.5rem) + 6rem);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 0;
  font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.page-nav a {
  color: #8b8b96;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.page-nav a:hover { color: #f2f1ec; border-bottom-color: #c3c8d2; }
.page-nav a:focus-visible { outline: 2px solid #c3c8d2; outline-offset: 3px; }
.page-nav .mine { color: #8b8b96; }

.colophon {
  max-width: calc(var(--measure, 68ch) + var(--gutter, 9.5rem) + 6rem);
  margin: 0 auto;
  padding: 2rem 1.5rem calc(3rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #16161c;
  font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: #6b6b75;
}
.colophon a { color: #8b8b96; }
.colophon a:hover { color: #f2f1ec; }

/* ---- print ----
   Print-to-PDF is the tidiest way to walk off with a whole document, so the
   printed version is the notice and nothing else. */
@media print {
  body > * { display: none !important; }
  body::before {
    content: "© Abdullah Bilal — abdullahbilal.nxera.io. This page is published for reading on the web and is not available in print.";
    display: block;
    padding: 3rem;
    font: 400 13px/1.7 ui-monospace, Consolas, monospace;
    color: #000;
  }
}
