/* ============================================================
   Kesttrel — brand layer on top of MudBlazor.
   Palette derives from the logo: near-black ground, brushed
   steel foreground. No accent colour, by design.
   ============================================================ */

/* ---------- fonts (self-hosted: no visitor data goes to a font CDN) ---------- */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* The site is dark-only: native scrollbars, form controls and autofill follow suit. */
    color-scheme: dark;

    --k-bg:            #08090A;
    --k-bg-raised:     #0E1012;
    --k-bg-sunken:     #050607;
    --k-line:          rgba(255, 255, 255, 0.09);
    --k-line-strong:   rgba(255, 255, 255, 0.18);
    --k-line-input:    rgba(255, 255, 255, 0.38); /* field outlines need 3:1 against the card */
    --k-text:          #E9ECEF;
    --k-text-dim:      #9BA3AB;
    --k-text-faint:    #7D858B; /* 5.1:1 on cards, 5.3:1 on the page */
    --k-steel:         #C9CFD6;
    --k-steel-bright:  #F4F6F8;

    --k-gutter: 24px;
    --k-radius: 4px;
    --k-maxw: 1160px;
}

html, body {
    background-color: var(--k-bg);
    color: var(--k-text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Scales the fallback font to Inter's x-height while it loads, so the swap does not shift layout. */
    font-size-adjust: from-font;
}

html {
    @media (prefers-reduced-motion: no-preference) {
        scroll-behavior: smooth;
    }
}

/* ---------- skip link (first focusable element on every page) ---------- */
.k-skip {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 2100;
    padding: 10px 16px;
    border-radius: var(--k-radius);
    background: var(--k-steel-bright);
    color: #08090A;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    translate: 0 -200%;
}

.k-skip:focus { translate: 0 0; }

/* The skip link focuses <main> programmatically; it is not interactive, so no ring. */
#content:focus { outline: none; }

/* ---------- boot splash (shown before Blazor starts) ---------- */
.boot {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--k-bg);
}

.boot__mark { width: 64px; height: auto; opacity: .85; }

.boot__bar {
    width: 140px;
    height: 1px;
    background: var(--k-line-strong);
    overflow: hidden;
}

.boot__bar span {
    display: block;
    width: 40%;
    height: 100%;
    background: var(--k-steel-bright);

    @media (prefers-reduced-motion: no-preference) {
        animation: boot-sweep 1.1s ease-in-out infinite;
    }
}

@keyframes boot-sweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

#blazor-error-ui {
    background: #1A1206;
    color: #F0E2C8;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .4);
    display: none;
    left: 0;
    padding: 12px 20px;
    position: fixed;
    width: 100%;
    z-index: 2000;
    font-size: .875rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 8px;
    padding: 4px 8px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
}

/* ---------- typography ---------- */
.k-eyebrow {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--k-text-faint);
    display: block;
    /* Also used on <h2> section titles, so override heading defaults. */
    font-weight: 400;
    margin: 0 0 18px;
}

.k-eyebrow--rule { display: flex; align-items: center; gap: 14px; }
.k-eyebrow--rule::after { content: ""; flex: 1; height: 1px; background: var(--k-line); }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.022em; color: var(--k-text); text-wrap: balance; }

.k-lead, .k-body, .k-list li { text-wrap: pretty; }

/* <FocusOnNavigate> moves focus to the page heading for screen readers; it is not interactive, so no ring. */
h1:focus { outline: none; }

.k-display {
    font-size: clamp(2.4rem, 1.6rem + 3.5vw, 4.1rem);
    line-height: 1.04;
    font-weight: 600;
    letter-spacing: -0.035em;
    margin: 0;
}

.k-h2 {
    font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem);
    line-height: 1.14;
    letter-spacing: -0.03em;
    margin: 0 0 20px;
}

.k-h3 {
    font-size: 1.15rem;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin: 0 0 10px;
}

.k-lead {
    font-size: clamp(1.02rem, 0.9rem + 0.4vw, 1.2rem);
    line-height: 1.62;
    color: var(--k-text-dim);
    font-weight: 300;
    max-width: 62ch;
    margin: 0;
}

.k-body {
    font-size: .95rem;
    line-height: 1.68;
    color: var(--k-text-dim);
    font-weight: 300;
    max-width: 68ch;
    margin: 0 0 16px;
}

.k-body:last-child { margin-bottom: 0; }

.k-mono {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: .78rem;
    letter-spacing: .04em;
    color: var(--k-text-faint);
}

.k-steel {
    background: linear-gradient(100deg, #FFFFFF 0%, #DDE3E8 34%, #AAB3BA 62%, #F2F5F7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- layout ---------- */
.k-shell { max-width: var(--k-maxw); margin: 0 auto; padding: 0 var(--k-gutter); }
.k-section { padding: 96px 0; border-top: 1px solid var(--k-line); }
.k-section--flush { border-top: none; }
.k-section--tight { padding: 64px 0; }

@media (max-width: 700px) {
    .k-section { padding: 64px 0; }
    :root { --k-gutter: 20px; }
}

/* ---------- app bar ---------- */
.k-appbar {
    background: rgba(8, 9, 10, 0.78) !important;
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--k-line);
    box-shadow: none !important;
}

.k-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: inherit;
}

.k-brand__mark { width: 30px; height: auto; display: block; }

.k-brand__name {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--k-steel-bright);
}

.k-navlink {
    position: relative;
    font-size: .875rem;
    font-weight: 400;
    color: var(--k-text-dim);
    text-decoration: none;
    padding: 6px 0;
    transition: color .18s ease;
}

.k-navlink:hover { color: var(--k-text); }
.k-navlink.active { color: var(--k-steel-bright); }

.k-navlink.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: var(--k-steel);
}

/* ---------- drawer (mobile nav) ---------- */
.k-drawer { background: var(--k-bg-raised) !important; border-right: 1px solid var(--k-line); }
.k-drawer__link {
    display: block;
    padding: 14px 24px;
    font-size: .95rem;
    color: var(--k-text-dim);
    text-decoration: none;
    border-bottom: 1px solid var(--k-line);
}
.k-drawer__link:hover, .k-drawer__link.active { color: var(--k-steel-bright); }

/* ---------- buttons ---------- */
.k-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: .875rem;
    font-weight: 500;
    letter-spacing: .01em;
    padding: 11px 22px;
    border-radius: var(--k-radius);
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, translate .18s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.k-btn--primary { background: var(--k-steel-bright); color: #08090A; }
.k-btn--primary:hover {
    background: #FFFFFF;

    @media (prefers-reduced-motion: no-preference) {
        translate: 0 -1px;
    }
}

.k-btn--ghost { border-color: var(--k-line-strong); color: var(--k-text); background: transparent; }
.k-btn--ghost:hover { border-color: var(--k-steel); background: rgba(255, 255, 255, .04); }

.k-btn--sm { padding: 8px 16px; font-size: .82rem; }

.k-btn__arrow { transition: translate .18s ease; }

.k-btn:hover .k-btn__arrow {
    @media (prefers-reduced-motion: no-preference) {
        translate: 3px 0;
    }
}

/* ---------- cards ---------- */
.k-card {
    background: var(--k-bg-raised);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    padding: 30px 28px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: border-color .2s ease, background .2s ease;
}

.k-card:hover { border-color: var(--k-line-strong); background: #101315; }

.k-card__num {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: .72rem;
    color: var(--k-text-faint);
    letter-spacing: .1em;
    margin-bottom: 22px;
}

/* ---------- lists ---------- */
.k-list { list-style: none; padding: 0; margin: 18px 0 0; }

.k-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 11px;
    font-size: .9rem;
    line-height: 1.6;
    color: var(--k-text-dim);
    font-weight: 300;
}

.k-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .62em;
    width: 7px;
    height: 1px;
    background: var(--k-steel);
    opacity: .7;
}

/* ---------- capability strip ---------- */
.k-strip { display: flex; flex-wrap: wrap; gap: 10px; }

.k-chip {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: .72rem;
    letter-spacing: .06em;
    color: var(--k-text-dim);
    border: 1px solid var(--k-line);
    border-radius: 2px;
    padding: 6px 11px;
    background: var(--k-bg-sunken);
}

/* ---------- hero ---------- */
.k-hero {
    position: relative;
    padding: clamp(88px, 13vh, 152px) 0 clamp(72px, 10vh, 112px);
    overflow: hidden;
}

.k-hero__glow {
    position: absolute;
    top: -18%;
    right: -10%;
    width: min(760px, 82vw);
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(200, 208, 216, .075) 0%, rgba(200, 208, 216, 0) 66%);
    pointer-events: none;
}

.k-hero__mark {
    width: clamp(150px, 24vw, 250px);
    height: auto;
    opacity: .92;
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, .7));
}

.k-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* ---------- numbered process rows ---------- */
.k-step {
    border-top: 1px solid var(--k-line);
    padding: 28px 0;
    display: grid;
    grid-template-columns: 64px 220px 1fr;
    gap: 24px;
    align-items: start;
}

.k-step:last-child { border-bottom: 1px solid var(--k-line); }

.k-step__idx {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: .78rem;
    color: var(--k-text-faint);
    padding-top: 4px;
}

@media (max-width: 780px) {
    .k-step { grid-template-columns: 1fr; gap: 10px; }
    .k-step__idx { padding-top: 0; }
}

/* ---------- footer ---------- */
.k-footer {
    border-top: 1px solid var(--k-line);
    background: var(--k-bg-sunken);
    padding: 56px 0 32px;
}

.k-footer a { color: var(--k-text-dim); text-decoration: none; font-size: .875rem; }
.k-footer a:hover { color: var(--k-steel-bright); }

.k-footer__bottom {
    margin-top: 44px;
    padding-top: 22px;
    border-top: 1px solid var(--k-line);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}

/* ---------- emphasis & variants ---------- */
.k-strong { color: var(--k-text); font-weight: 500; }

.k-card--invert {
    background: linear-gradient(160deg, #15181B 0%, var(--k-bg-raised) 70%);
    border-color: var(--k-line-strong);
}

.k-btn[disabled] { opacity: .6; cursor: progress; translate: none; }

/* ---------- contact form ---------- */
.k-form { display: grid; gap: 24px; }

.k-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

@media (max-width: 700px) {
    .k-form__row { grid-template-columns: 1fr; }
}

.k-field label {
    display: block;
    margin-bottom: 9px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--k-text-faint);
}

.k-field__hint { text-transform: none; letter-spacing: .02em; opacity: .75; margin-left: 6px; }

.k-input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    background: var(--k-bg-sunken);
    border: 1px solid var(--k-line-input);
    border-radius: var(--k-radius);
    color: var(--k-text);
    font: inherit;
    font-size: .95rem;
    font-weight: 300;
    line-height: 1.55;
    transition: border-color .18s ease;
}

.k-input::placeholder { color: var(--k-text-faint); }

.k-input:focus { border-color: var(--k-steel); }

textarea.k-input { min-height: 170px; resize: vertical; }

/* Blazor adds .invalid to inputs that failed validation, .validation-message to the messages. */
.k-input.invalid { border-color: rgba(222, 150, 150, .7); }

.validation-message { margin-top: 7px; font-size: .8rem; color: #E2A8A8; }

.k-notice {
    padding: 14px 16px;
    border: 1px solid var(--k-line-strong);
    border-radius: var(--k-radius);
    font-size: .88rem;
    line-height: 1.6;
    color: var(--k-text-dim);
}

.k-notice--error { border-color: rgba(222, 150, 150, .4); color: #EBCACA; background: rgba(222, 150, 150, .05); }

/* Honeypot: present for bots, invisible and unreachable for people. */
.k-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.k-contact-link {
    display: inline-block;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: -0.015em;
    text-decoration: none;
    color: var(--k-steel-bright);
    border-bottom: 1px solid var(--k-line-strong);
    padding-bottom: 2px;
    transition: border-color .18s ease;
    word-break: break-word;
}

.k-contact-link:hover { border-color: var(--k-steel); }

/* ---------- focus ---------- */
:where(a[href], button, summary, .k-input):focus-visible {
    outline: 2px solid var(--k-steel);
    outline-offset: 3px;
}

/* MudBlazor's icon button resets outline with a class selector; restore the ring for the menu toggle. */
.mud-icon-button:focus-visible {
    outline: 2px solid var(--k-steel);
    outline-offset: 2px;
}

/* ---------- misc ---------- */
.k-rule { height: 1px; background: var(--k-line); border: 0; margin: 0; }
a { color: var(--k-steel-bright); }
::selection { background: rgba(230, 236, 241, .22); }
.mud-main-content { background: var(--k-bg); }

/* ---------- inline links ---------- */
.k-link { color: var(--k-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--k-line-strong); }
.k-link:hover { color: var(--k-steel-bright); text-decoration-color: var(--k-steel); }

/* ---------- faq (native <details>, so it works and is crawlable before Blazor starts) ---------- */
.k-faq { border-top: 1px solid var(--k-line); }
.k-faq:last-child { border-bottom: 1px solid var(--k-line); }

.k-faq summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 20px 0;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--k-text);
}

.k-faq summary::-webkit-details-marker { display: none; }

.k-faq summary::before {
    content: "+";
    /* The summary already exposes the open/closed state; keep the glyph out of the spoken name. */
    content: "+" / "";
    flex-shrink: 0;
    width: 12px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    color: var(--k-text-faint);

    @media (prefers-reduced-motion: no-preference) {
        transition: rotate .18s ease;
    }
}

.k-faq[open] summary::before { rotate: 45deg; }
.k-faq summary:hover { color: var(--k-steel-bright); }

/* Answers line up with the question text, past the marker. */
.k-faq .k-body { margin: 0 0 22px 26px; }

/* Slide open/closed where supported (::details-content, interpolate-size); instant elsewhere. */
.k-faq::details-content {
    interpolate-size: allow-keywords;
    overflow: clip;
    contain: layout;
}

.k-faq:not([open])::details-content { block-size: 0; }

@media (prefers-reduced-motion: no-preference) {
    .k-faq::details-content {
        transition: block-size, content-visibility, display;
        transition-duration: .25s;
        transition-timing-function: ease-in-out;
        transition-behavior: allow-discrete;
    }
}
