/* ==========================================================================
   PSConsole.Web - global styles only
   Tokens, base typography, shared building blocks (container, buttons,
   section rhythm). Page and component styles live in their .razor.css files.

   Palette: GitHub-style night neutrals for the surfaces, with Windows
   PowerShell's command yellow as the single accent.
   Sizes in px; fluid values through clamp(), so media queries are rarely
   needed.
   ========================================================================== */

:root {
    /* Color */
    --bg:           #0D1117;   /* page canvas */
    --bg-subtle:    #161B22;   /* alternate sections, panels, window chrome */
    --bg-inset:     #010409;   /* code wells, terminal, recessed inputs */
    --surface:      #1C2128;   /* dialogs and raised overlays */
    --rule:         #30363D;   /* hairlines and borders */
    --paper:        #E6EDF3;   /* primary text */
    --haze:         #8B949E;   /* secondary text */
    --cmdlet:       #F2D04B;   /* the single accent: PowerShell command yellow */
    --cmdlet-ink:   #1B1500;   /* text on the accent */
    --ok:           #4EC98B;   /* connected / success, status only */

    /* Syntax (used by the window mocks) */
    --syn-keyword:  #7FB2FF;
    --syn-variable: #A5D8FF;
    --syn-string:   #E8B27D;
    --syn-comment:  #6B86AE;
    --syn-type:     #78DCC5;
    --syn-param:    #C9D3E3;

    /* Type */
    --font-sans: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

    /* Type scale (~1.25 ratio, fluid between ~360px and ~1440px viewports) */
    --step--1: clamp(14px, 0.15vw + 13.4px, 15px);
    --step-0:  clamp(16px, 0.25vw + 15.1px, 18px);
    --step-1:  clamp(19px, 0.45vw + 17.4px, 23px);
    --step-2:  clamp(23px, 0.85vw + 20px, 30px);
    --step-3:  clamp(28px, 1.6vw + 22.2px, 44px);
    --step-4:  clamp(36px, 3.2vw + 24.5px, 72px);

    /* Space */
    --gutter:   clamp(16px, 4vw, 56px);
    --section:  clamp(72px, 9vw, 144px);
    --stack:    clamp(16px, 1.6vw, 24px);
    --page-max: 1240px;
    --measure:  680px;     /* body text line length, under 80 characters */

    --radius-s: 4px;
    --radius-m: 10px;

    color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────── */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 88px;   /* anchors land below the sticky header */
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--paper);
    font-family: var(--font-sans);
    font-size: var(--step-0);
    line-height: 1.6;
    font-kerning: normal;
    font-variant-numeric: proportional-nums;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.01em; line-height: 1.25; }

p {
    margin: 0;
    text-wrap: pretty;
}

a {
    color: var(--paper);
    text-decoration-color: var(--cmdlet);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

a:hover {
    color: var(--cmdlet);
}

code, kbd, samp, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

code {
    color: var(--cmdlet);
    overflow-wrap: anywhere;   /* long paths and URLs wrap instead of widening the page */
}

img, svg, video, iframe {
    display: block;
    max-width: 100%;
}

::selection {
    background: var(--cmdlet);
    color: var(--cmdlet-ink);
}

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

h1:focus {
    outline: none;   /* FocusOnNavigate moves focus here; no ring for that */
}

/* ── Shared building blocks ───────────────────────────────────────────── */

.container {
    width: 100%;
    max-width: calc(var(--page-max) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section);
}

.section-intro {
    display: grid;
    gap: var(--stack);
    max-width: var(--measure);
    margin-bottom: clamp(40px, 5vw, 72px);
}

.lede {
    font-size: var(--step-1);
    line-height: 1.5;
    color: var(--haze);
    max-width: var(--measure);
}

.muted {
    color: var(--haze);
}

/* Terminal-style line above a page title: <p class="kicker"><span class="kicker-prompt">PS C:\&gt;</span>...</p> */
.kicker {
    font: 500 var(--step--1) var(--font-mono);
    color: var(--haze);
    letter-spacing: 0.02em;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
}

.kicker-prompt {
    margin-right: 1ch;
    color: var(--cmdlet);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Buttons: one primary (yellow) per view, quiet for everything else */
.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px clamp(18px, 1.6vw, 24px);
    border: 2px solid transparent;
    border-radius: var(--radius-s);
    font: 600 var(--step-0)/1 var(--font-sans);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.button--primary {
    background: var(--cmdlet);
    color: var(--cmdlet-ink);
}

.button--primary:hover {
    background: var(--paper);
    color: var(--cmdlet-ink);
}

.button--quiet {
    background: transparent;
    border-color: var(--rule);
    color: var(--paper);
}

.button--quiet:hover {
    border-color: var(--cmdlet);
    color: var(--paper);
}

.button svg {
    width: 18px;
    height: 18px;
    flex: none;
}

/* ── Product mocks (SVG) ──────────────────────────────────────────────
   Shared by every illustration component (AppWindowMock, TerminalsMock,
   IntuneMock, DatabaseMock, CloudMock, RemoteMock) so they read as one app. */

.mk          { display: block; width: 100%; height: auto; }
.mk-frame    { fill: var(--bg); stroke: var(--rule); }
.mk-chrome   { fill: var(--bg-subtle); }
.mk-inset    { fill: var(--bg-inset); }
.mk-surface  { fill: var(--surface); stroke: var(--rule); }
.mk-rule     { fill: none; stroke: var(--rule); }
.mk-pill     { fill: transparent; stroke: var(--rule); }
.mk-accent   { fill: var(--cmdlet); }
.mk-ok       { fill: var(--ok); }
.mk-busy     { fill: #F0B429; }
.mk-sel      { fill: rgb(242 208 75 / 0.12); }
.mk-hl       { fill: rgb(230 237 243 / 0.05); }
.mk-icon     { fill: none; stroke: var(--haze); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.mk-t        { font: 500 13px var(--font-sans); fill: var(--paper); }
.mk-t.dim    { fill: var(--haze); }
.mk-t.b      { font-weight: 700; }
.mk-t.sm     { font-size: 11.5px; }
.mk-t.acc    { fill: var(--cmdlet); }
.mk-t.on     { fill: var(--cmdlet-ink); font-weight: 700; }
.mk-t.ok     { fill: var(--ok); }

.mk-code     { font: 400 15px var(--font-mono); fill: var(--syn-param); white-space: pre; }
.mk-code.sm  { font-size: 13px; }
.mk-code.out { fill: var(--paper); }
.sx-kw       { fill: var(--syn-keyword); }
.sx-cmd      { fill: var(--cmdlet); }
.sx-var      { fill: var(--syn-variable); }
.sx-str      { fill: var(--syn-string); }
.sx-type     { fill: var(--syn-type); }
.sx-par      { fill: var(--haze); }
.sx-com      { fill: var(--syn-comment); font-style: italic; }
.sx-gut      { fill: #484F58; }
.sx-ok       { fill: var(--ok); }
.sx-warn     { fill: #F0B429; }

/* ── Framework UI ─────────────────────────────────────────────────────── */

.blazor-error-boundary {
    padding: 16px 20px;
    border-left: 4px solid #FF6B6B;
    background: var(--bg-subtle);
    color: var(--paper);
}

.blazor-error-boundary::after {
    content: "This part of the page failed to load. Reload the page to try again.";
}

/* ── Motion preferences ───────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}
