/* ===========================================================================
   FIELD MANUAL: the site's visual system
   ---------------------------------------------------------------------------
   The site is set in the language of the Chasma architectural infographic
   (~/sites/Chasma/Chasma_Codebase_Infographic.pdf): deep navy, panels drawn
   with thin coloured outlines instead of shadows, uppercase engineering
   headings, monospace only for data. Colour is a role, not decoration: each
   fm-accent-* class points a panel at one MudBlazor palette role, and the
   palette (Components/Layout/SiteTheme.cs) supplies an AA-passing value for
   dark and for light. Dark is the default; light is the same manual printed.
   =========================================================================== */

@font-face {
    font-family: "Archivo";
    src: url("fonts/archivo-var-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
}

@font-face {
    font-family: "Martian Mono";
    src: url("fonts/martian-mono-var-latin.woff2") format("woff2");
    font-weight: 100 800;
    font-stretch: 75% 112.5%;
    font-display: swap;
}

:root {
    --fm-mono: "Martian Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    --fm-radius: 14px;
    --fm-outline: 1.5px;
    --fm-accent: var(--mud-palette-lines-inputs);
}

/* Accent roles. A panel, tag or row picks one; everything inside reads --fm-accent. */
.fm-accent-cyan   { --fm-accent: var(--mud-palette-primary); }
.fm-accent-amber  { --fm-accent: var(--mud-palette-secondary); }
.fm-accent-violet { --fm-accent: var(--mud-palette-tertiary); }
.fm-accent-green  { --fm-accent: var(--mud-palette-success); }
.fm-accent-coral  { --fm-accent: var(--mud-palette-error); }
.fm-accent-sky    { --fm-accent: var(--mud-palette-info); }
.fm-accent-orange { --fm-accent: var(--mud-palette-warning); }

/* ---- Browser surfaces: the parts nobody draws still carry the design ---- */
::selection {
    background: color-mix(in srgb, var(--mud-palette-primary) 32%, transparent);
    color: var(--mud-palette-text-primary);
}

html {
    caret-color: var(--mud-palette-primary);
    scrollbar-color: var(--mud-palette-lines-inputs) var(--mud-palette-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--mud-palette-background); }
::-webkit-scrollbar-thumb {
    background: var(--mud-palette-lines-inputs);
    border-radius: 999px;
    border: 3px solid var(--mud-palette-background);
}

:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 3px;
    border-radius: 6px;
}

a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

/* Display headings run slightly expanded, like the manual's titles. */
.mud-typography-h1, .mud-typography-h2, .mud-typography-h3,
.mud-typography-h4, .mud-typography-h5 {
    font-stretch: 112%;
    text-wrap: balance;
}

.mud-typography-body1, .mud-typography-body2 { text-wrap: pretty; }

/* Monospace is for data: figures, code, tags. Tabular numerals keep columns honest. */
.fm-mono, code, pre, kbd {
    font-family: var(--fm-mono);
    font-variant-numeric: tabular-nums slashed-zero;
}

/* ---- Panels: outlines, not elevation ---- */
.mud-paper.mud-paper-outlined,
.mud-paper:not(.mud-appbar):not(.mud-drawer):not(.mud-popover):not(.mud-snackbar):not(.mud-dialog):not(.mud-table),
.mud-card {
    background-color: var(--mud-palette-surface);
    border: var(--fm-outline) solid var(--mud-palette-lines-default);
    border-radius: var(--fm-radius);
    box-shadow: none;
}

.fm-panel {
    background-color: var(--mud-palette-surface);
    border: var(--fm-outline) solid color-mix(in srgb, var(--fm-accent) 70%, transparent);
    border-radius: var(--fm-radius);
}

.mud-paper.fm-panel,
.mud-card.fm-panel {
    border-color: color-mix(in srgb, var(--fm-accent) 70%, transparent);
}

/* Panel header: uppercase title in the accent, a tag pill on the right, a hairline beneath. */
.fm-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.fm-panel-title {
    margin: 0;
    color: var(--fm-accent);
}

/* The manual's pill tag: mono caps, outlined in the accent, a whisper of fill. */
.fm-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-family: var(--fm-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--fm-accent);
    background: color-mix(in srgb, var(--fm-accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--fm-accent) 65%, transparent);
    border-radius: 999px;
    padding: 0.42em 0.8em;
}

/* MudChips become manual pills: outlined, mono, never a solid low-contrast fill. */
.mud-chip {
    font-family: var(--fm-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
}

.mud-chip.mud-chip-outlined {
    border-width: 1px;
}

/* Filter chips: the selected one is a solid accent pill with the palette's contrast ink. */
.mud-chip.mud-chip-filled.mud-chip-color-primary {
    color: var(--mud-palette-primary-text);
}

/* Buttons: squarer corners than Mud's default pill, matching the panels. */
.mud-button-root.mud-button { border-radius: 10px; }

.mud-button-outlined { border-width: 1.5px; }

html, body {
    margin: 0;
    max-width: 100%;
    overflow-x: hidden;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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;
}

.record-body {
    color: var(--mud-palette-text-primary);
    line-height: 1.7;
}

.record-body h1,
.record-body h2,
.record-body h3,
.record-body h4 {
    color: var(--mud-palette-text-primary);
    margin-top: 1.75em;
    margin-bottom: 0.6em;
    line-height: 1.25;
}

.record-body h1 {
    font-size: 2rem;
}

.record-body h2 {
    font-size: 1.6rem;
}

.record-body h3 {
    font-size: 1.3rem;
}

.record-body h4 {
    font-size: 1.1rem;
}

.record-body p {
    margin: 0 0 1em 0;
}

.record-body ul,
.record-body ol {
    margin: 0 0 1em 0;
    padding-left: 1.75em;
}

.record-body li {
    margin-bottom: 0.35em;
}

.record-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.5em 0;
}

.record-body pre {
    background-color: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    padding: 1em;
    margin: 0 0 1em 0;
    overflow-x: auto;
}

.record-body code {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

.record-body :not(pre) > code {
    background-color: var(--mud-palette-background-gray);
    border-radius: 3px;
    padding: 0.15em 0.4em;
}

.record-body pre code {
    background-color: transparent;
    padding: 0;
}

.record-body table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 0 0 1em 0;
    max-width: 100%;
}

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

.record-body th {
    background-color: var(--mud-palette-background-gray);
    font-weight: 600;
}

.record-body blockquote {
    margin: 0 0 1em 0;
    padding: 0.25em 1.1em;
    border-left: 1px solid var(--mud-palette-secondary);
    color: var(--mud-palette-text-secondary);
    font-style: italic;
}
/* Markdown body links are plain <a> tags (not MudLink), so give them the same
   primary accent color MudLink uses on the About/Projects pages. */
.record-body a {
    color: var(--mud-palette-primary);
    text-decoration: none;
}
.record-body a:hover {
    text-decoration: underline;
}
/* ---------------------------------------------------------------------------
   Float utilities.

   NOTE: this project has NO Tailwind. MudBlazor supplies the spacing utilities
   (ma-/mb-/mr-/mx-/my- on a 4px scale — note `ma-`, not Tailwind's `m-`), but
   it ships no float utilities at all, so these are defined here.

   Float is used deliberately rather than a grid: it is the only layout method
   where text sits beside the image and then reclaims the full width once it
   clears the bottom. A grid would keep the text in a narrow column all the way
   down.
   --------------------------------------------------------------------------- */

/* Only float once there is room. Below this width a ~420px image would squeeze
   the body copy into an unreadably narrow gutter, so it stacks instead. */
@media (min-width: 900px) {
    .float-left {
        float: left;
        margin-right: 24px;
    }
}

/* Start a block below any float rather than wrapping into the gap beside it. */
.clear-float {
    clear: both;
}

/* ---------------------------------------------------------------------------
   Focus ring on the page heading after navigation
   ---------------------------------------------------------------------------
   Routes.razor uses <FocusOnNavigate Selector="h1" />, which moves focus to the
   page heading on every route change so screen readers announce the new page.
   That is worth keeping. The side effect is that the browser paints a focus
   outline around the h1 for mouse users too, which reads as a stray box hugging
   the heading text and disappears on the next click.

   :focus-visible is the browser's own judgement about whether focus arrived by
   keyboard. Suppressing the ring only when it did NOT keeps keyboard users'
   outlines fully intact.
   --------------------------------------------------------------------------- */
:focus:not(:focus-visible) {
    outline: none;
}

/* FocusOnNavigate sets tabindex="-1" on its target to make it focusable at all.
   Belt and braces: those elements are never keyboard-reachable on purpose, so they
   should never paint a ring. */
[tabindex="-1"]:focus {
    outline: none;
}

/* ---------------------------------------------------------------------------
   Home hero: bio beside the JSON object, then the figures strip
   ---------------------------------------------------------------------------
   Grid so the bio and jason.json share one row on wide screens and stack below
   MudBlazor's md breakpoint (960px).
   --------------------------------------------------------------------------- */
.hero-cols {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

.hero-cols > * { min-width: 0; }

@media (min-width: 960px) {
    .hero-cols {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        gap: 3.5rem;
        align-items: start;
    }
}

.fm-measure { max-width: 68ch; }

.fm-id-name {
    font-weight: 800;
    letter-spacing: 0.01em;
}

.fm-id-roles {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.fm-id-roles li { display: inline-flex; align-items: center; gap: 0.5rem; }

.fm-hero-title {
    margin: 0 0 0.75rem;
    font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4.25rem);
    max-width: 18ch;
}

.fm-hero-sub {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--mud-palette-text-secondary);
}

/* Availability, said as a sentence next to the action rather than a 12px pill. */
.fm-status {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--mud-palette-text-primary);
    max-width: 52ch;
}

.fm-status svg { flex: none; fill: var(--mud-palette-success); transform: translateY(1px); }

/* jason.json: an amber code panel, as in the manual's code boxes. */
.json-card {
    padding: 1rem 1.25rem 1.25rem;
    max-width: 100%;
}

.json-card .fm-panel-head { margin-bottom: 0.75rem; padding-bottom: 0.6rem; }

.json-card .fm-panel-title { font-size: 0.8125rem; font-weight: 600; }

.json-card pre {
    margin: 0;
    background: none;
    font-family: var(--fm-mono);
    font-size: 0.78rem;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

@media (min-width: 600px) {
    .json-card pre { font-size: 0.82rem; }
}

/* Punctuation recedes; keys, strings and numbers each keep one role colour. */
.json-card .j-p { color: var(--mud-palette-text-secondary); }
.json-card .j-k { color: var(--mud-palette-primary); }
.json-card .j-s { color: var(--mud-palette-success); }
.json-card .j-n { color: var(--mud-palette-error); }

/* The figures strip: the manual's top row of tiles, real numbers only. */
.fm-stats {
    list-style: none;
    margin: 2.5rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 960px) {
    .fm-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
}

.fm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    padding: 1.1rem 0.75rem;
    background: var(--mud-palette-surface);
    border: var(--fm-outline) solid color-mix(in srgb, var(--fm-accent) 70%, transparent);
    border-radius: var(--fm-radius);
}

.fm-stat-n {
    font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--fm-accent);
}

.fm-stat-l {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.35;
    color: var(--mud-palette-text-secondary);
}

.fm-section-title {
    margin: 3.5rem 0 1.25rem;
    color: var(--mud-palette-text-primary);
}

/* Allow MudChips inside main content to wrap cleanly on narrow phone screens
   instead of forcing horizontal overflow with white-space: nowrap. */
.mud-main-content .mud-chip {
    max-width: 100%;
    height: auto;
    min-height: 26px;
    padding-top: 3px;
    padding-bottom: 3px;
}

.mud-main-content .mud-chip .mud-chip-content {
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.35;
}

@media (max-width: 599.98px) {
    h1.mud-typography-h3 {
        font-size: 2rem;
        line-height: 1.2;
    }

    h2.mud-typography-h5 {
        font-size: 1.25rem;
        line-height: 1.3;
    }
}

/* ---------------------------------------------------------------------------
   App-bar CTA: full label with room, compact "Contact" on phones
   ---------------------------------------------------------------------------
   Pure CSS swap (not MudHidden) so both buttons render server-side and the right
   one shows on the first paint. Hide the compact one by default; below 600px hide
   the wide one and reveal the compact. inline-flex matches MudButton's root.
   --------------------------------------------------------------------------- */
.cta-compact { display: none; }

@media (max-width: 599.98px) {
    .cta-wide { display: none; }
    .cta-compact { display: inline-flex; }
}

/* ---------------------------------------------------------------------------
   Responsive top-bar navigation (desktop links vs mobile drawer button)
   ---------------------------------------------------------------------------
   Aligned to MudBlazor's md breakpoint (960px) so the horizontal nav links only
   show when there is ample width alongside the brand and CTA button.
   --------------------------------------------------------------------------- */
.nav-mobile-only { display: none; }
.nav-desktop-only { display: inline-flex; }

@media (max-width: 959.98px) {
    .nav-mobile-only { display: inline-flex; }
    .nav-desktop-only { display: none; }
}

/* ---------------------------------------------------------------------------
   Dark-mode architectural / Chasma arena grid & background ships
   --------------------------------------------------------------------------- */
.chasma-bg-grid,
.chasma-arena-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    display: none;
}

/* The arena grid shows in both modes: blue-tinted lines on the navy manual,
   and the same grid as faint graph paper on the printed (light) one. */
.chasma-bg-grid {
    display: block;
    background-image:
        linear-gradient(var(--fm-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--fm-grid-line) 1px, transparent 1px);
    background-size: 44px 44px;
}

html[data-theme="dark"] { --fm-grid-line: rgba(96, 165, 250, 0.075); }
html[data-theme="light"] { --fm-grid-line: rgba(14, 116, 144, 0.07); }

.chasma-arena-layer { display: block; }

.chasma-ship {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.32;
    will-change: transform;
    filter: drop-shadow(0 0 4px rgba(148, 163, 184, 0.25));
}

.chasma-flame {
    animation: chasma-flicker 0.14s infinite alternate;
}

@keyframes chasma-flicker {
    from { opacity: 0.45; transform: scaleY(0.85); }
    to   { opacity: 0.95; transform: scaleY(1.15); }
}

/* Keep layout content above the fixed background grid and ships */
.mud-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* ---------------------------------------------------------------------------
   App bar, nav and footer (Field Manual)
   --------------------------------------------------------------------------- */
.fm-appbar {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.fm-wordmark {
    font-weight: 850;
    font-stretch: 115%;
    font-size: 1.125rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.fm-nav { gap: 1.75rem; }

.fm-nav-link {
    position: relative;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.5rem 0;
    transition: color 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.fm-nav-link:hover { color: var(--mud-palette-text-primary); }

.fm-nav-link.active { color: var(--mud-palette-text-primary); }

/* The current page wears a short cyan bar under its label, like an active tab on the manual. */
.fm-nav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    border-radius: 2px;
    background: var(--mud-palette-primary);
}

.fm-footer-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

/* ---------------------------------------------------------------------------
   Record entries: accent + outline style per kind
   ---------------------------------------------------------------------------
   Spec solid cyan, Plan dashed violet, Post-mortem double coral, Note dotted
   amber. The outline style means the kind survives without colour.
   --------------------------------------------------------------------------- */
.fm-kind-spec       { --fm-accent: var(--mud-palette-primary);   --fm-kind-line: solid; }
.fm-kind-plan       { --fm-accent: var(--mud-palette-tertiary);  --fm-kind-line: dashed; }
.fm-kind-postmortem { --fm-accent: var(--mud-palette-error);     --fm-kind-line: double; }
.fm-kind-note       { --fm-accent: var(--mud-palette-secondary); --fm-kind-line: dotted; }

.fm-entry {
    position: relative;
    margin-bottom: 1rem;
    padding: 1.1rem 1.35rem 1.2rem;
    background: var(--mud-palette-surface);
    border: 2px var(--fm-kind-line, solid) color-mix(in srgb, var(--fm-accent) 60%, transparent);
    border-radius: var(--fm-radius);
    transition: border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.fm-kind-postmortem.fm-entry { border-width: 3px; }

.fm-entry:hover,
.fm-entry:focus-within {
    border-color: var(--fm-accent);
    background: color-mix(in srgb, var(--fm-accent) 5%, var(--mud-palette-surface));
}

.fm-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.9rem;
    margin-bottom: 0.6rem;
}

.fm-entry-date {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.fm-entry-title { margin: 0; }

/* The whole card is the hit area; the link stays the accessible name. */
.fm-entry-title a {
    color: var(--mud-palette-text-primary);
    text-decoration: none;
}

.fm-entry-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--fm-radius);
}

.fm-entry:hover .fm-entry-title a { color: var(--fm-accent); }

.fm-entry-summary {
    margin: 0.4rem 0 0;
    max-width: 75ch;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--mud-palette-text-secondary);
}

.fm-entry-lede {
    font-size: 1.25rem;
    line-height: 1.5;
    max-width: 60ch;
    color: var(--mud-palette-text-secondary);
}

/* ---------------------------------------------------------------------------
   /work and /projects panels
   --------------------------------------------------------------------------- */
.fm-panel-strong { border-width: 2px; }

.fm-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding-bottom: 0.6rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid color-mix(in srgb, var(--fm-accent) 70%, transparent);
}

/* Project cards inside a group take the group's accent at a quieter strength. */
.fm-group .mud-card.fm-panel {
    border-color: color-mix(in srgb, var(--fm-accent) 38%, var(--mud-palette-lines-default));
}

.fm-group .mud-card.fm-panel:hover {
    border-color: color-mix(in srgb, var(--fm-accent) 75%, transparent);
}

.fm-project-meta {
    margin: 0.15rem 0 0.75rem;
    font-size: 0.72rem;
    line-height: 1.6;
    color: var(--mud-palette-text-secondary);
}

/* Stack list: the manual's mono package column, as a quiet inline list. */
.fm-stack {
    list-style: none;
    margin: 0.9rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    font-family: var(--fm-mono);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    color: var(--fm-accent);
}

.fm-stack li + li::before {
    content: "+";
    margin-right: 1rem;
    color: var(--mud-palette-text-secondary);
}

/* Reading measure inside panels: long prose lines stop at about 75 characters. */
.fm-panel .mud-typography-body1,
.fm-panel .mud-typography-body2 { max-width: 75ch; }

/* Outlines carry depth here; filled buttons sit flat in both modes. */
.mud-button-filled,
.mud-button-filled:hover,
.mud-button-filled:focus-visible { box-shadow: none; }

/* Clickable chips (filters, inquiry picks) get a thumb-sized hit area. */
.mud-chip.mud-clickable { min-height: 36px; padding-inline: 14px; }

/* Phones: the app bar holds menu, mark, wordmark, Contact and the theme toggle
   in ~390px, so the wordmark narrows and the compact CTA tightens. */
@media (max-width: 599.98px) {
    .fm-wordmark { font-size: 0.875rem; font-stretch: 100%; letter-spacing: 0; }
    .fm-appbar .mud-toolbar { padding-inline: 8px; gap: 2px; }
    .cta-compact.mud-button-root { min-width: 0; padding-inline: 12px; margin-left: 8px; }
    .json-card { padding: 0.9rem 1rem 1rem; }
    .json-card pre { font-size: 0.7rem; }
}

/* Light mode: ships sketched on the graph paper. Darker and a touch stronger than
   the dark-mode ships because ink on white needs no glow to read. */
.chasma-ship-sketch {
    opacity: 0.72;
    filter: none;
}

/* Long-form reading (The Record entries): a book measure, not the container width. */
.record-body { max-width: 72ch; font-size: 1.0625rem; }
.record-body pre, .record-body table { max-width: 100%; }

/* About: the portrait sits in an outline like every other panel. */

/* ---- Finish-review fixes ---- */

/* A panel with no category: neutral outline, title in the body ink. */
.fm-neutral { --fm-accent: var(--mud-palette-text-primary); }
.fm-neutral.fm-panel { border-color: var(--mud-palette-lines-inputs); }

/* Figures share one treatment: they are facts, not categories. Numerals sit on one
   row whatever their label length. */
.fm-stat {
    --fm-accent: var(--mud-palette-primary);
    justify-content: flex-start;
    border-color: var(--mud-palette-lines-inputs);
}

/* Record rows: title with the kind pill at its right, date beneath in mono. */
.fm-entry-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.fm-entry-head .fm-tag { margin-top: 0.2rem; }

.fm-entry-date { margin: 0.35rem 0 0; }

/* Progressive disclosure: a quiet mono toggle in the panel's accent. */
.fm-disclose > summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 36px;
    font-family: var(--fm-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fm-accent);
}

.fm-disclose > summary::-webkit-details-marker { display: none; }

.fm-disclose > summary::before {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid color-mix(in srgb, var(--fm-accent) 65%, transparent);
    border-radius: 6px;
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.fm-disclose[open] > summary::before { content: "\2212"; }

/* Phones: the two hero actions share one width. */
@media (max-width: 599.98px) {
    .hero-cols .mud-button-root { width: 100%; }
}

/* ---------------------------------------------------------------------------
   Record entry: reading column plus a side column of entry facts.
   The body keeps its 72ch measure; the side column fills the space that
   measure would otherwise leave empty, and stays in view while reading.
   --------------------------------------------------------------------------- */
.fm-entry-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "body" "side";
    row-gap: 0;
}

.fm-entry-header { grid-area: head; }
.fm-entry-body   { grid-area: body; }
.fm-entry-aside  { grid-area: side; margin-top: 3rem; display: grid; gap: 1rem; align-content: start; }

@media (min-width: 1024px) {
    .fm-entry-layout {
        grid-template-columns: minmax(0, 72ch) minmax(15rem, 21rem);
        grid-template-areas: "head side" "body side";
        grid-template-rows: auto 1fr;
        justify-content: space-between;
        column-gap: 3rem;
    }

    .fm-entry-aside {
        margin-top: 0.4rem;
        align-self: start;
    }

    .fm-entry-meta-inline { display: none; }
}

@media (min-width: 1024px) and (min-height: 640px) {
    .fm-entry-aside { position: sticky; top: calc(var(--mud-appbar-height, 68px) + 1.5rem); }
}

.fm-aside-panel { padding: 1rem 1.15rem; }

/* Facts: a small mono label over its value, like a spec sheet. */
.fm-facts { margin: 0; display: grid; gap: 0.85rem; }
.fm-facts > div { display: grid; gap: 0.3rem; }
.fm-facts dt {
    font-family: var(--fm-mono);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}
.fm-facts dd { margin: 0; font-size: 0.9375rem; line-height: 1.4; }
.fm-facts dd.fm-mono { font-size: 0.8125rem; }
.fm-facts a { color: var(--mud-palette-primary); text-underline-offset: 0.2em; }

/* Previous / next: each link is a full-width row, direction in mono above the title. */
.fm-step {
    display: grid;
    gap: 0.25rem;
    padding: 0.7rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.fm-step:first-child { padding-top: 0; }
.fm-step:last-child { border-bottom: 0; padding-bottom: 0; }
.fm-step:hover { color: var(--mud-palette-primary); }
.fm-step-dir {
    font-family: var(--fm-mono);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}
.fm-step-all {
    font-family: var(--fm-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mud-palette-primary);
}

.fm-aside-cta { padding: 0.25rem 0.15rem 0; }
.fm-aside-cta p {
    margin: 0 0 0.6rem;
    font-size: 0.9375rem;
    color: var(--mud-palette-text-secondary);
}

/* ---------------------------------------------------------------------------
   About: narrative on the left at reading width, portrait and facts on the
   right. On phones the portrait leads, the facts follow the story.
   --------------------------------------------------------------------------- */
.fm-about {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "photo" "main" "facts";
    gap: 1.5rem;
}

.fm-about-side { display: contents; }
.fm-about-photo { grid-area: photo; max-width: min(420px, 100%); border: var(--fm-outline) solid var(--mud-palette-lines-default); border-radius: var(--fm-radius); }
.fm-about-facts { grid-area: facts; }
.fm-about-main { grid-area: main; min-width: 0; }
.fm-about-main .fm-measure { max-width: 68ch; }

@media (min-width: 1024px) {
    .fm-about {
        grid-template-columns: minmax(0, 68ch) minmax(17rem, 22rem);
        grid-template-areas: "main side";
        justify-content: space-between;
        column-gap: 3rem;
    }

    .fm-about-side {
        grid-area: side;
        display: grid;
        gap: 1rem;
        align-content: start;
        align-self: start;
    }

    .fm-about-photo,
    .fm-about-facts { grid-area: auto; }
    .fm-about-photo { max-width: 100%; }
}

/* Portrait plus facts is ~800px tall: only pin it where the whole column fits. */
@media (min-width: 1024px) and (min-height: 900px) {
    .fm-about-side { position: sticky; top: calc(var(--mud-appbar-height, 68px) + 1.5rem); }
}

/* ---------------------------------------------------------------------------
   /work tracks: the problem at reading width on the left, the track's two
   actions in a column on the right, divided by a hairline.
   --------------------------------------------------------------------------- */
.fm-track { display: grid; gap: 1rem; }
.fm-track-main > :last-child { margin-bottom: 0 !important; }
.fm-track-side { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

@media (min-width: 960px) {
    .fm-track {
        grid-template-columns: minmax(0, 68ch) minmax(14rem, 17rem);
        justify-content: space-between;
        column-gap: 2.5rem;
    }

    .fm-track-side {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        align-self: start;
        gap: 0.75rem;
        padding-left: 1.5rem;
        border-left: 1px solid var(--mud-palette-lines-default);
    }

    .fm-track-side .mud-button-root { justify-content: flex-start; text-align: left; white-space: normal; }
    .fm-track-side .mud-button-outlined { justify-content: center; }
}

/* Two short statements read better beside each other than stacked at 68ch. */
.fm-split { display: grid; gap: 1rem; }
@media (min-width: 960px) {
    .fm-split { grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
}
.fm-split > * { margin: 0; max-width: 60ch; }

/* Phones already show type and date under the title; skip the repeat. */
@media (max-width: 1023.98px) {
    .fm-entry-aside > .fm-aside-panel:first-child { display: none; }
    /* About's facts repeat the copy above them; on phones the page should end on how to reach me. */
    .fm-about-facts { display: none; }
}

/* The landscape closes the story across the full page width, below both columns. */
.fm-about-wide {
    display: block;
    width: 100%;
    border: var(--fm-outline) solid var(--mud-palette-lines-default);
    border-radius: var(--fm-radius);
}

/* ---------------------------------------------------------------------------
   Admin-edited copy rendered from Markdown (/work, /projects). The wrapper carries
   the typography class the old MudText did; paragraphs inside never nest, and
   links match MudLink (primary, underline on hover).
   --------------------------------------------------------------------------- */
.fm-copy p { margin: 0 0 0.75em; }
.fm-copy > :last-child { margin-bottom: 0; }
.fm-copy a { color: var(--mud-palette-primary); text-decoration: none; }
.fm-copy a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------------
   Admin dashboard: one panel per thing you can change.
   --------------------------------------------------------------------------- */
.fm-admin-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .fm-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fm-admin-card { padding: 1.25rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; }
.fm-admin-card h2 { margin: 0; }
.fm-admin-what { margin: 0; color: var(--mud-palette-text-secondary); font-size: 0.9375rem; }
.fm-admin-count { margin: 0; font-size: 0.75rem; color: var(--mud-palette-text-secondary); }
.fm-admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding-top: 0.5rem; }
.fm-admin-links { margin: 0.25rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.fm-admin-links a { color: var(--mud-palette-primary); font-weight: 600; text-decoration: none; }
.fm-admin-links a:hover { text-decoration: underline; }
.fm-admin-note { color: var(--mud-palette-text-secondary); font-size: 0.875rem; }
