/* ============================================================
   HACKR — Forensics • Investigations • Intelligence
   Truth, backed by evidence.

   Design intent: a forensic practice, not a hacker movie.

   Typography is IBM Plex — a family drawn from IBM's own machine heritage,
   so the computing lineage sits in the letterforms instead of in costume.
   Plex Sans carries headings and body in sentence case: authority comes from
   size, weight and spacing, never from shouting. Plex Mono carries the
   machine layer — hashes, case numbers, exhibit tags, timestamps — where
   monospace is functionally correct because a human has to check a SHA-256
   character by character.

   Uppercase survives only on small technical labels, where it reads as
   machine labelling rather than emphasis.

   Structure is unchanged: exhibit tags, hairline rules, generous negative
   space. Signal green marks status and confirmation only; never decoration.
   ============================================================ */

/* ---------- Self-hosted typefaces ----------
   IBM Plex, SIL Open Font License 1.1. Self-hosted because the CSP is
   `font-src 'self'` — linking a font CDN would both weaken that policy and
   leak every visitor's IP to a third party. Some of those visitors are
   reporting a crime. See static/fonts/LICENSE.md.

   Plex Sans ships as a VARIABLE font: one 45 KB file covers weights 100–700,
   instead of four static files at 45 KB each. */

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/static/fonts/plex-sans-var.woff2") format("woff2-variations"),
         url("/static/fonts/plex-sans-var.woff2") format("woff2");
    font-weight: 100 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "IBM Plex Mono";
    src: url("/static/fonts/plex-mono-400.woff2") format("woff2");
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "IBM Plex Mono";
    src: url("/static/fonts/plex-mono-500.woff2") format("woff2");
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "IBM Plex Mono";
    src: url("/static/fonts/plex-mono-600.woff2") format("woff2");
    font-weight: 600; font-style: normal; font-display: swap;
}


:root {
    --midnight:   #0B0D10;
    --graphite:   #1A1F24;
    --gunmetal:   #2A3138;
    --signal:     #7CFF6B;
    --olive:      #4E5B3C;
    --smoke:      #B8BDC3;
    --offwhite:   #E8ECEF;
    --amber:      #F2A93B;
    --alert:      #D64545;

    /* One family, two widths of voice. IBM Plex is drawn from IBM's own
       machine heritage — Selectric, punch cards, mainframes — so the
       computing lineage is in the letterforms rather than in costume.
       Display and body are the same face at different weights: a serious
       practice speaks in one voice, not two. */
    --font-display: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system,
                    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system,
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* The machine layer. Everything a computer produced and a human must be
       able to check character-by-character — SHA-256 hashes, case numbers,
       exhibit tags, timestamps — is set here. Monospace is functionally
       correct for hashes, so the technical character is earned, not applied. */
    --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular,
                 Menlo, Consolas, "Liberation Mono", monospace;

    --measure: 68ch;
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --rule: 1px solid var(--gunmetal);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--midnight);
    color: var(--smoke);
    font-family: var(--font-sans);
    font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* Headings: sentence case, medium-heavy, slightly tightened. Authority here
   comes from size and spacing, not from shouting. Uppercase is reserved for
   the small technical labels below, where it reads as machine labelling. */
h1, h2, h3, h4 {
    color: var(--offwhite);
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.14;
    letter-spacing: -0.018em;
    margin: 0 0 0.5em;
    text-wrap: balance;
}

a { color: var(--offwhite); text-decoration-color: var(--gunmetal);
    text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }

:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 3px;
    border-radius: 2px;
}

.wrap { max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Exhibit label: the recurring signature element ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--smoke);
}
.tag::before {
    content: "";
    width: 1.75rem;
    height: 1px;
    background: var(--signal);
    flex: none;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--midnight) 88%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: var(--rule);
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.5rem;
}
.brand {
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    text-decoration: none;
}
.brand-name {
    font-family: var(--font-mono);
    font-size: 1.1875rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--offwhite);
}
.brand-sub {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--smoke);
    opacity: 0.75;
}
.nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.nav a {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 450;
    letter-spacing: 0;
    text-decoration: none;
    color: var(--smoke);
}
.nav a:hover { color: var(--offwhite); }
.nav .btn { color: var(--midnight); }
@media (max-width: 640px) {
    .nav a:not(.btn) { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.4rem;
    border: 1px solid transparent;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease,
                color .15s ease, transform .15s ease;
}
.btn-primary {
    background: var(--signal);
    color: var(--midnight);
}
.btn-primary:hover { background: #92ff85; transform: translateY(-1px); }
.btn-ghost {
    background: transparent;
    border-color: var(--gunmetal);
    color: var(--offwhite);
}
.btn-ghost:hover { border-color: var(--signal); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding-block: clamp(4rem, 12vh, 8.5rem) clamp(3.5rem, 9vh, 6rem);
    border-bottom: var(--rule);
    overflow: hidden;

    /* Forensic examination bench. The photograph is composed with its subject
       weighted right and the left third falling to near-black, so the headline
       sits on genuinely dark ground rather than on a scrim doing all the work.
       Measured: the headline region averages 14/255 luminance, worst-case
       brightest pixel 80/255 — about 6.6:1 against off-white at the worst
       point, which clears WCAG AA for body text, not merely large text.

       image-set serves WebP (33 KB) to everything modern and falls back to
       JPEG. Self-hosted: the CSP is `img-src 'self' data:`. */
    background-color: var(--midnight);
    background-image:
        /* scrim first — it paints over the photo */
        linear-gradient(100deg,
            var(--midnight) 0%,
            color-mix(in srgb, var(--midnight) 92%, transparent) 28%,
            color-mix(in srgb, var(--midnight) 55%, transparent) 52%,
            transparent 78%),
        image-set(
            url("/static/img/hero-forensics-1600.webp") type("image/webp"),
            url("/static/img/hero-forensics-1600.jpg") type("image/jpeg"));
    background-repeat: no-repeat;
    background-position: center right, center right;
    background-size: cover, cover;
}

/* A faint measurement grid over the photograph — the examination overlay,
   not decoration. Masked to the text side so it never sits on the subject. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--gunmetal) 1px, transparent 1px),
        linear-gradient(to bottom, var(--gunmetal) 1px, transparent 1px);
    background-size: 88px 88px;
    opacity: 0.16;
    mask-image: radial-gradient(ellipse 60% 70% at 20% 45%, #000 10%, transparent 70%);
    pointer-events: none;
}

/* Blend the photograph into the credential strip below it rather than
   ending on a hard cut. */
.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 40%;
    background: linear-gradient(to bottom, transparent, var(--midnight));
    pointer-events: none;
}

/* Narrow screens: the copy has to cross more of the frame, so the smaller
   crop gets a heavier vertical scrim and the subject is pushed further right. */
@media (max-width: 900px) {
    .hero {
        background-image:
            linear-gradient(to bottom,
                color-mix(in srgb, var(--midnight) 88%, transparent) 0%,
                color-mix(in srgb, var(--midnight) 78%, transparent) 45%,
                color-mix(in srgb, var(--midnight) 94%, transparent) 100%),
            image-set(
                url("/static/img/hero-forensics-900.webp") type("image/webp"),
                url("/static/img/hero-forensics-1600.jpg") type("image/jpeg"));
        background-position: center, 72% center;
    }
    .hero::before { opacity: 0.1; }
}
.hero .wrap { position: relative; }
.hero h1 {
    font-size: clamp(2.5rem, 1.6rem + 4.4vw, 5rem);
    font-weight: 600;
    margin-block: 1.5rem 1.25rem;
    letter-spacing: -0.032em;
    line-height: 1.04;
}
.hero h1 .accent { color: var(--signal); }
.hero p.lede {
    max-width: 52ch;
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    color: var(--smoke);
    margin-bottom: 2.25rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.875rem; }

/* Credential strip under the hero */
.credentials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1px;
    background: var(--gunmetal);
    border-block: var(--rule);
}
.credentials div {
    background: var(--midnight);
    padding: 1.5rem var(--gutter);
}
.credentials dt {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--smoke);
    opacity: .8;
    margin-bottom: .4rem;
}
.credentials dd {
    margin: 0;
    color: var(--offwhite);
    font-size: 0.9375rem;
    line-height: 1.4;
}

/* ---------- Sections ---------- */
section { padding-block: clamp(3.5rem, 9vh, 6.5rem); }
.section-head { margin-bottom: clamp(2rem, 5vh, 3.5rem); max-width: var(--measure); }
.section-head h2 {
    font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
    font-weight: 600;
    letter-spacing: -0.022em;
    margin-top: 0.9rem;
}
.section-head p { max-width: 60ch; margin-bottom: 0; }

/* ---------- Services ---------- */
.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1px;
    background: var(--gunmetal);
    border: var(--rule);
}
.service {
    background: var(--graphite);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: background-color .2s ease;
}
.service:hover { background: #1f252b; }
.service-no {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--signal);
}
.service h3 { font-size: 1.1875rem; margin: 0; }
.service p { margin: 0; font-size: 0.9375rem; }

/* ---------- Method / chain of custody ---------- */
.method {
    display: grid;
    gap: 1px;
    background: var(--gunmetal);
    border: var(--rule);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.step { background: var(--graphite); padding: clamp(1.4rem, 3vw, 2rem); }
.step-no {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.16em;
    color: var(--smoke);
    display: block;
    margin-bottom: 0.85rem;
}
.step h3 { font-size: 1.0625rem; margin-bottom: 0.4rem; }
.step p { margin: 0; font-size: 0.875rem; }

/* ---------- Intake form ---------- */
.intake {
    border: var(--rule);
    background: var(--graphite);
}
.intake-head {
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border-bottom: var(--rule);
}
.intake-head h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem); margin-top: .85rem; }
.intake-head p { margin-bottom: 0; max-width: 58ch; }

form { padding: clamp(1.5rem, 3vw, 2.25rem); }
.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1.25rem;
}
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field.full { grid-column: 1 / -1; }
label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--smoke);
}
label .req { color: var(--signal); }

input, select, textarea {
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--offwhite);
    background: var(--midnight);
    border: 1px solid var(--gunmetal);
    border-radius: 2px;
    padding: 0.7rem 0.85rem;
    width: 100%;
    transition: border-color .15s ease;
}
textarea { min-height: 8.5rem; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
    border-color: var(--signal);
    outline: none;
}
input[type="file"] { padding: 0.55rem; font-size: 0.8125rem; }
input[type="file"]::file-selector-button {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: var(--gunmetal);
    color: var(--offwhite);
    border: 0;
    border-radius: 2px;
    padding: .5rem .8rem;
    margin-right: .8rem;
    cursor: pointer;
}
select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--smoke) 50%),
                      linear-gradient(135deg, var(--smoke) 50%, transparent 50%);
    background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

/* The lawful-use notice. Deliberately prominent — this is a legal boundary,
   not fine print. */
.notice {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--olive);
    border-left: 3px solid var(--amber);
    border-radius: 2px;
    background: color-mix(in srgb, var(--amber) 6%, transparent);
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--offwhite);
}
.notice strong { color: var(--amber); }

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: .5rem;
}
.form-note { font-size: 0.8125rem; color: var(--smoke); margin: 0; }

/* Submission result */
.result {
    grid-column: 1 / -1;
    display: none;
    padding: 1.25rem;
    border-radius: 2px;
    font-size: 0.9375rem;
}
.result.show { display: block; }
.result.ok {
    border: 1px solid var(--olive);
    border-left: 3px solid var(--signal);
    background: color-mix(in srgb, var(--signal) 7%, transparent);
    color: var(--offwhite);
}
.result.err {
    border: 1px solid var(--gunmetal);
    border-left: 3px solid var(--alert);
    background: color-mix(in srgb, var(--alert) 8%, transparent);
    color: var(--offwhite);
}
.result .ref {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--signal);
    margin-top: .6rem;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: var(--rule);
    padding-block: 3rem 2.5rem;
    font-size: 0.8125rem;
}
.footer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    align-items: flex-start;
}
.site-footer .brand-name { font-size: .875rem; }
.footer-legal { max-width: 46ch; margin: .75rem 0 0; opacity: .85; }
.footer-meta {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .7;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
