@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Quiet atmospheric ground: a faint radial vignette darkens the page edges in
   dark mode — the one deliberate mood device, static and colourless. */
body {
    background-color: var(--mud-palette-background);
    background-image: radial-gradient(120% 90% at 50% -10%,
        rgba(255, 255, 255, 0.025) 0%, rgba(0, 0, 0, 0) 38%,
        rgba(0, 0, 0, 0.28) 100%);
    background-attachment: fixed;
}

/* The mono chrome (brand + statusline) carries the terminal identity. */
.brand {
    font-family: 'Source Code Pro', Menlo, Monaco, Consolas, monospace;
    letter-spacing: -0.5px;
}

h1:focus {
    outline: none;
}

/* Visible, on-palette keyboard focus everywhere. */
:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Page transition: replays on each navigation via @key in MainLayout. */
.page-fade {
    animation: page-fade-in 0.35s ease both;
}

@keyframes page-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-fade {
        animation: none;
    }
}

/* Links/buttons are owned by MudBlazor's palette — no hardcoded template blue. */

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N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Y3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ── Status line (top bar) ── */
.statusline {
    position: sticky;
    top: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 14px;
    font-family: 'Source Code Pro', Menlo, Monaco, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
    user-select: none;
}

.statusline .sl-spacer {
    flex: 1 1 auto;
}

/* Dim separator glyph between segments. */
.statusline .sl-sep {
    color: var(--mud-palette-text-secondary);
    opacity: 0.4;
    padding: 0 2px;
}

/* Brand reads as a shell path: bright-ish name + faint tilde. */
.statusline .sl-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    padding: 5px 6px;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    letter-spacing: -0.3px;
    transition: color 0.13s ease;
}

.statusline .sl-brand .sl-tilde {
    color: var(--mud-palette-text-secondary);
    opacity: 0.7;
}

.statusline .sl-brand:hover {
    color: var(--mud-palette-primary);
}

/* Segments idle muted, lift toward primary text on hover — brightness, not colour. */
.statusline .sl-seg {
    appearance: none;
    background: transparent;
    border: none;
    font: inherit;
    cursor: pointer;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    padding: 6px 7px;
    border-radius: 3px;
    transition: color 0.13s ease, background-color 0.13s ease;
}

.statusline .sl-seg:hover {
    color: var(--mud-palette-text-primary);
    background-color: rgba(127, 127, 127, 0.12);
}

.statusline .sl-seg--accent {
    color: var(--mud-palette-text-primary);
}

.statusline .sl-glyph {
    font-size: 14px;
    line-height: 1;
    padding: 5px 7px;
}

/* ── Flyout nav (hobbies) — a status-line segment that opens a menu ── */
.flyout-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.flyout-trigger {
    background: transparent;
    border: none;
    color: var(--mud-palette-text-secondary);
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    padding: 6px 7px;
    cursor: pointer;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    transition: color 0.13s ease, background-color 0.13s ease;
}

.flyout-trigger::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor;
    opacity: 0.45;
    margin-left: 5px;
    transition: transform 0.13s ease;
}

.flyout-nav:hover .flyout-trigger,
.flyout-nav:focus-within .flyout-trigger {
    color: var(--mud-palette-text-primary);
    background-color: rgba(127, 127, 127, 0.12);
}

.flyout-nav:hover .flyout-trigger::after,
.flyout-nav:focus-within .flyout-trigger::after {
    transform: rotate(180deg);
}

.flyout-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 130px;
    background: var(--mud-palette-surface);
    border-radius: 4px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--mud-palette-lines-default);
    padding: 4px 0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.13s ease, transform 0.13s ease, visibility 0s linear 0.13s;
    z-index: 1300;
}

.flyout-nav:hover .flyout-menu,
.flyout-nav:focus-within .flyout-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.13s ease, transform 0.13s ease, visibility 0s linear 0s;
}

.flyout-link {
    display: block;
    padding: 6px 16px;
    font-size: 0.875rem;
    font-family: inherit;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.1s ease;
}

a.flyout-link:hover,
a.flyout-link:focus-visible {
    background-color: rgba(127, 127, 127, 0.12);
    color: inherit;
    text-decoration: none;
}

/* ── Command header — quiet shell-prompt eyebrow above inner pages ── */
.cmd-header {
    font-family: 'Source Code Pro', Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--mud-palette-text-primary);
    margin: 0.25rem 0 1.5rem;
    user-select: none;
}

.cmd-header .cmd-prompt {
    color: var(--mud-palette-text-secondary);
    opacity: 0.65;
    margin-right: 0.5ch;
}

/* ── Admin back link — a quiet breadcrumb pinned to the top of inner admin
   pages, so "back" sits in one predictable place instead of floating beside
   a two-line title. ── */
.admin-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5ch;
    font-family: 'Source Code Pro', Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    margin-bottom: 0.75rem;
    opacity: 0.8;
    transition: opacity 120ms ease, color 120ms ease;
}

.admin-back:hover,
.admin-back:focus-visible {
    opacity: 1;
    color: var(--mud-palette-text-primary);
}

.admin-back .admin-back-arrow {
    font-size: 0.95rem;
    line-height: 1;
    transition: transform 120ms ease;
}

.admin-back:hover .admin-back-arrow {
    transform: translateX(-2px);
}

/* ── Content pages (data-driven blog/portfolio pages at /{slug}) ── */
.content-head {
    margin-bottom: 1.75rem;
}

.content-head h1 {
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -0.4px;
    margin: 0;
    color: var(--mud-palette-text-primary);
}

.content-head .content-summary {
    margin: 0.5rem 0 0;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--mud-palette-text-secondary);
}

/* Rendered Markdown body — comfortable reading measure and rhythm. */
.content-page {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--mud-palette-text-primary);
}

.content-page > :first-child {
    margin-top: 0;
}

.content-page h1,
.content-page h2,
.content-page h3,
.content-page h4 {
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.2px;
    margin: 2rem 0 0.75rem;
    color: var(--mud-palette-text-primary);
}

.content-page h1 { font-size: 1.6rem; }
.content-page h2 { font-size: 1.35rem; }
.content-page h3 { font-size: 1.15rem; }
.content-page h4 { font-size: 1rem; }

.content-page p {
    margin: 0 0 1.1rem;
}

.content-page a {
    color: var(--mud-palette-primary);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--mud-palette-primary) 35%, transparent);
    transition: border-color 0.13s ease;
}

.content-page a:hover {
    border-bottom-color: var(--mud-palette-primary);
}

.content-page ul,
.content-page ol {
    margin: 0 0 1.1rem;
    padding-left: 1.5rem;
}

.content-page li {
    margin: 0.3rem 0;
}

.content-page img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.content-page blockquote {
    margin: 1.25rem 0;
    padding: 0.25rem 0 0.25rem 1rem;
    border-left: 3px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-text-secondary);
}

.content-page code {
    font-family: 'Source Code Pro', Menlo, Monaco, Consolas, monospace;
    font-size: 0.875em;
    background: rgba(127, 127, 127, 0.14);
    padding: 0.12em 0.4em;
    border-radius: 4px;
}

.content-page pre {
    background: rgba(127, 127, 127, 0.12);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 0 0 1.1rem;
}

.content-page pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.55;
}

.content-page hr {
    border: none;
    border-top: 1px solid var(--mud-palette-lines-default);
    margin: 2rem 0;
}

.content-page table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 1.1rem;
    font-size: 0.95rem;
}

.content-page th,
.content-page td {
    border: 1px solid var(--mud-palette-lines-default);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.content-page th {
    background: rgba(127, 127, 127, 0.1);
    font-weight: 600;
}

/* Monospace Markdown source in the page editor. */
.editor-mono .mud-input-slot,
.editor-mono textarea {
    font-family: 'Source Code Pro', Menlo, Monaco, Consolas, monospace !important;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Side-by-side Markdown source + live preview in the page editor. */
.editor-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

.editor-split-pane {
    min-width: 0;   /* let panes shrink instead of overflowing the grid */
}

.editor-preview {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    padding: 0.75rem 1rem;
    overflow: auto;
    max-height: 32rem;
}

/* Stack the editor and preview on narrow screens. */
@media (max-width: 959px) {
    .editor-split {
        grid-template-columns: 1fr;
    }
}

/* ── Terminal-style auth screens (Login + Signup share this) ── */
/* Drops all card chrome and reads as a shell session: a command eyebrow, a set
   of prompt-aligned boxed fields, and a run line. */
.auth-term {
    width: min(440px, 92vw);
    margin: 14vh auto 0;
    font-family: 'Source Code Pro', Menlo, Monaco, Consolas, monospace;
}

.auth-form {
    margin-top: 1.5rem;
}

/* Each field is a prompt label + bare input boxed by an outer border. */
.auth-field {
    display: flex;
    align-items: baseline;
    gap: 1ch;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
}

.auth-field + .auth-field {
    margin-top: 0.75rem;
}

.auth-field:focus-within {
    border-color: var(--mud-palette-primary);
}

.auth-prompt {
    flex: 0 0 auto;
    color: var(--mud-palette-text-secondary);
    opacity: 0.7;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Strip MudBlazor's field chrome so only the raw caret + text remain. */
.auth-input {
    flex: 1 1 auto;
    margin: 0;
}

.auth-input .mud-input {
    margin-top: 0;
    font-family: inherit;
    font-size: 0.9rem;
}

.auth-input .mud-input.mud-input-underline::before,
.auth-input .mud-input.mud-input-underline::after {
    display: none;
}

.auth-input input {
    padding: 0;
    color: var(--mud-palette-text-primary);
}

.auth-input input::placeholder {
    color: var(--mud-palette-text-secondary);
    opacity: 0.4;
}

/* Run line — reads like submitting a command at the prompt. */
.auth-run {
    display: block;
    width: 100%;
    margin-top: 2rem;
    padding: 0.55rem 0;
    background: none;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    color: var(--mud-palette-text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease;
}

.auth-run:hover:not(:disabled) {
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary);
}

.auth-run:disabled {
    cursor: default;
    opacity: 0.6;
}

.auth-run .auth-prompt {
    opacity: 0.7;
    margin-right: 0.5ch;
}

.auth-cursor::after {
    content: "▋";
    margin-left: 0.4ch;
    animation: auth-blink 1s steps(1) infinite;
}

@keyframes auth-blink {
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-cursor::after { animation: none; }
}

.auth-foot {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
}

.auth-foot .auth-link {
    font-family: inherit;
    font-size: 0.8rem;
}

/* ── Print: strip site chrome (used by the CV man page) ── */
@media print {
    body {
        background: #fff;
        background-image: none;
    }

    .statusline,
    #blazor-error-ui {
        display: none !important;
    }

    .content {
        padding-top: 0;
    }
}
