/* =====================================================================
   MetricSpark — code & content protection layer (CSS side)
   © MetricSpark · Aman Thakur · All rights reserved.

   This is a *deterrent*, not absolute protection. Anyone determined can
   curl the page or disable JS — the HTML must reach the browser to render.
   Real IP protection = legal layer (ToS + copyright) on top of this.
===================================================================== */

/* --- Selection / copy disabling ------------------------------------- */
html, body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;   /* iOS long-press menu */
    -webkit-tap-highlight-color: transparent;
}

/* Re-enable selection inside form fields so people can still type */
input, textarea, select, [contenteditable="true"] {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
}

/* --- Image protection ----------------------------------------------- */
img, picture, svg {
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
}

/* --- Block printing ------------------------------------------------- */
@media print {
    html, body { background: #fff !important; }
    body * { visibility: hidden !important; }
    body::after {
        content: "Printing of this page is disabled. © MetricSpark · All rights reserved.";
        visibility: visible !important;
        position: fixed;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font: 600 18px/1.4 system-ui, -apple-system, sans-serif;
        color: #333;
        text-align: center;
        padding: 40px;
    }
}

/* --- Watermark overlay ---------------------------------------------- */
/* Diagonal repeating wordmark across the page — faint enough to not
   interfere with reading, dense enough to spoil screenshots. */
.ms-watermark {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background-repeat: repeat;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='220'><text x='20' y='130' font-family='-apple-system, system-ui, Segoe UI, Helvetica, Arial, sans-serif' font-size='16' font-weight='600' fill='rgba(0,0,0,0.045)' transform='rotate(-22 210 110)'>%C2%A9 MetricSpark %E2%80%A2 Aman Thakur</text></svg>");
}

/* Bottom-right copyright badge */
.ms-watermark-badge {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 9999;
    pointer-events: none;
    font: 500 10.5px/1 -apple-system, system-ui, "Segoe UI", monospace;
    color: rgba(20,30,50,0.55);
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    padding: 6px 10px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    letter-spacing: 0.3px;
    user-select: none;
}

/* --- DevTools-open blur (set by protect.js) ------------------------ */
.ms-locked {
    filter: blur(10px) saturate(0.4);
    pointer-events: none;
    transition: filter 200ms ease-out;
}
.ms-lock-curtain {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: rgba(255,255,255,0.92);
    color: #0f172a;
    font: 600 16px/1.5 -apple-system, system-ui, "Segoe UI", sans-serif;
    text-align: center;
    padding: 40px;
}
.ms-lock-curtain small {
    font-weight: 400;
    font-size: 12px;
    color: #475569;
    max-width: 420px;
}
