/* Agent view: the portfolio as a rendered Markdown document.
   Same site, same header and footer. A cooler page, generous whitespace, and Markdown's own syntax
   (#, ##, -, `code`) kept faintly visible in monospace so it reads as the layer underneath. */

body.agent {
    --bg: #F1F4F8;
    --ink: #2A3A4C;
    --muted: rgba(42, 58, 76, 0.8);
    --muted-2: rgba(42, 58, 76, 0.72);
    --faint: rgba(42, 58, 76, 0.34);
    --line: rgba(38, 58, 84, 0.16);
    --surface: #FBFCFE;
}
.agent .site-header { background: rgba(241, 244, 248, 0.88); }
.agent .mono, .agent code { font-family: var(--font-mono); }
.agent a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--faint); text-decoration-thickness: 1px; }
.agent a:hover { text-decoration-color: var(--ink); }

/* ---------- Title block ---------- */
.a-hero { display: flex; flex-direction: column; gap: 16px; padding: 56px 0 24px; }
@media (min-width: 900px) { .a-hero { padding: 88px 0 64px; gap: 20px; } }
.a-file { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; font-size: 12px; color: var(--muted-2); letter-spacing: 0.02em; }
.a-file .raw { color: var(--muted-2); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 4px; padding: 6px 0; margin: -6px 0; }
.a-file .raw:hover { color: var(--ink); text-decoration-color: var(--ink); }
.agent h1 { font-family: var(--font-serif); font-size: 44px; line-height: 1.05; font-weight: 400; letter-spacing: -0.03em; color: var(--ink); }
@media (min-width: 768px) { .agent h1 { font-size: 64px; } }
.agent h1::before { content: '#'; font-family: var(--font-mono); font-size: 0.4em; letter-spacing: 0; color: var(--faint); margin-right: 0.6em; vertical-align: 0.35em; }
.a-tagline { font-family: var(--font-serif); font-size: 22px; line-height: 1.35; letter-spacing: -0.01em; color: var(--ink); max-width: 36rem; padding-left: 16px; border-left: 2px solid var(--ink); margin-top: 8px; }
@media (min-width: 768px) { .a-tagline { font-size: 26px; } }
.a-intro { font-family: var(--font-serif); font-size: 18px; line-height: 1.5; color: var(--muted); max-width: 40rem; }

/* ---------- Layout: one centered column, like a document ---------- */
.a-hero, .a-layout { max-width: 46rem; margin-inline: auto; }
.a-layout { padding: 56px 0 112px; }

/* ---------- The rendered document ---------- */
.md { min-width: 0; color: var(--ink); }
.md > * + * { margin-top: 16px; }
.md h2, .md h3, .md h4 { scroll-margin-top: calc(var(--header-h) + 16px); }
.md h2::before, .md h3::before, .md h4::before {
    content: attr(data-md);
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--faint);
    margin-right: 0.7em;
    letter-spacing: 0;
}

.md h2 { font-family: var(--font-serif); font-size: 34px; line-height: 1.15; font-weight: 400; letter-spacing: -0.025em; margin-top: 88px; padding-top: 32px; border-top: 1px solid var(--ink); }
.md h2:first-child { margin-top: 0; }
.md h2::before { font-size: 0.42em; vertical-align: 0.4em; }

.md h3 { font-family: var(--font); font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; margin-top: 56px; }
.md h2 + h3, .md p + h3:first-of-type { margin-top: 32px; }
.md h3::before { font-size: 0.6em; vertical-align: 0.1em; }

.md h4 { font-family: var(--font-mono); font-size: 13px; line-height: 1.4; font-weight: 500; letter-spacing: 0.02em; margin-top: 36px; }
.md h4::before { font-size: 1em; }

.md p { font-size: 16px; line-height: 1.7; color: var(--muted); }
.md strong { font-weight: 600; color: var(--ink); }
.md h4 + p, .md h4 + ul { margin-top: 10px; }

.md code {
    font-size: 0.86em;
    color: var(--ink);
    background: rgba(42, 58, 76, 0.07);
    border-radius: 4px;
    padding: 2px 6px;
    overflow-wrap: anywhere;
}

/* Lists: Markdown's own "-" marker, in mono */
.md ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.md li { position: relative; padding-left: 22px; font-size: 16px; line-height: 1.65; color: var(--muted); }
.md li::before { content: '-'; position: absolute; left: 4px; top: 0; font-family: var(--font-mono); color: var(--faint); }
.md li, .md li a { overflow-wrap: anywhere; }

/* ---------- Machine register ----------
   Same layout, set in monospace: the document reads like a file, not an article. Keys are tinted like a
   code editor's; everything else stays quiet. */
body.agent { --key: #2F5D8A; --bg: #EEF1F5; }
.agent .site-header { background: rgba(238, 241, 245, 0.88); }
.md, .a-hero { font-family: var(--font-mono); }

.a-file { display: flex; padding: 10px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); font-size: 11.5px; }
.agent h1 { font-family: var(--font-mono); font-size: 34px; font-weight: 500; letter-spacing: -0.04em; line-height: 1.15; }
@media (min-width: 768px) { .agent h1 { font-size: 48px; } }
.agent h1::before { font-size: 0.5em; vertical-align: 0.2em; }
.a-tagline { font-family: var(--font-mono); font-size: 16px; line-height: 1.6; letter-spacing: -0.01em; border-left-width: 2px; border-left-color: var(--key); }
@media (min-width: 768px) { .a-tagline { font-size: 18px; } }
.a-intro { font-family: var(--font-mono); font-size: 13px; line-height: 1.7; }
.a-intro em { font-style: normal; color: var(--muted-2); }
.a-intro em::before { content: '// '; color: var(--faint); }

.md h2 { font-family: var(--font-mono); font-size: 22px; font-weight: 500; letter-spacing: -0.03em; border-top: 1px solid var(--line); margin-top: 72px; padding-top: 24px; }
.md h3 { font-family: var(--font-mono); font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.md h4 { color: var(--key); font-size: 12px; text-transform: lowercase; letter-spacing: 0; }
.md h4::after { content: ':'; }
.md h4::before { color: var(--faint); }
.md p, .md li { font-size: 13.5px; line-height: 1.8; letter-spacing: -0.005em; }
.md strong { color: var(--key); font-weight: 500; }
.md code { background: none; border: 1px solid var(--line); color: var(--ink); }
.md a { text-decoration-color: var(--faint); }
.a-layout { padding-top: 16px; }

/* ---------- Tighter title block, line numbers, quieter raw link ---------- */
.a-hero { padding: 28px 0 4px; gap: 12px; }
@media (min-width: 900px) { .a-hero { padding: 36px 0 4px; gap: 14px; } }
.agent h1 { font-size: 30px; }
@media (min-width: 768px) { .agent h1 { font-size: 40px; } }
.a-tagline { margin-top: 2px; }
.a-layout { padding-top: 0; }
.md h2:first-child { padding-top: 20px; }
.a-file .raw { font-size: 10.5px; text-decoration: none; padding: 8px 0; margin: -8px 0; }
.a-file .raw:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Line numbers: the real line of that text in agent.md. Wide screens only. */
.md .ln { display: none; }
@media (min-width: 1000px) {
    .md h2, .md h3, .md h4, .md p, .md li { position: relative; }
    .md .ln {
        display: block;
        position: absolute;
        right: calc(100% + 28px);
        top: 0.55em;
        width: 3ch;
        text-align: right;
        font-family: var(--font-mono);
        font-size: 10.5px;
        font-style: normal;
        font-weight: 400;
        letter-spacing: 0;
        line-height: 1;
        color: var(--faint);
        user-select: none;
        pointer-events: none;
    }
    .md li .ln { right: calc(100% + 6px); }
}
.a-eof { max-width: 46rem; margin: 0 auto; padding: 0 0 96px; font-size: 11px; color: var(--faint); }
.a-eof::before { content: '~ '; }
@media (min-width: 1000px) { .md h2 .ln { top: 38px; } .md h3 .ln { top: 0.5em; } }

/* ---------- v2: a file being read ----------
   A command line, a response status, the front matter, then the document. An outline tracks the section in view. */
.a-hero { gap: 14px; }
.a-cmd { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); }
.a-cmd .prompt { color: var(--key); font-weight: 500; }
.caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 4px; vertical-align: -0.15em; background: var(--key); animation: caret 1.1s steps(1, end) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.a-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding: 10px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted-2); }
.a-status .ok { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }
.a-status .ok::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #2E8B57; box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.15); }
.a-status .raw { margin-left: auto; font-size: 11px; color: var(--muted-2); text-decoration: none; }
.a-status .raw + .raw { margin-left: 0; }
.a-status .raw:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.a-fm { position: relative; margin: 6px 0 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px; line-height: 1.75; color: var(--muted); white-space: pre-wrap; overflow-x: auto; }
.a-fm .fm-l { display: block; position: relative; }
.a-fm b { font-weight: 500; color: var(--key); }
.a-fm .fm-d { color: var(--faint); }
.a-fm .ln { display: none; }
.a-note { font-size: 12.5px; line-height: 1.7; color: var(--muted-2); }
.a-note::before { content: '// '; color: var(--faint); }
.agent h1 { margin-top: 10px; }
.a-tagline { margin-top: 0; }

/* Outline: a file tree beside the document on wide screens */
.a-layout { position: relative; }
.a-outline { display: none; }
@media (min-width: 1240px) {
    .a-outline { display: block; position: absolute; top: 0; bottom: 0; left: calc(100% + 64px); width: 190px; }
    .a-outline > * { position: sticky; }
    .a-outline-h { top: calc(var(--header-h) + 32px); margin-bottom: 10px; font-size: 11px; color: var(--muted-2); }
    .a-outline-h::before { content: '\25BE  '; color: var(--faint); }
    .a-outline ul { list-style: none; top: calc(var(--header-h) + 58px); }
    .a-outline a { display: flex; gap: 8px; padding: 3px 0; font-size: 11.5px; color: var(--muted-2); text-decoration: none; transition: color 0.2s ease; }
    .a-outline .tree { color: var(--faint); }
    .a-outline a:hover { color: var(--ink); }
    .a-outline a[aria-current="true"] { color: var(--key); }
    .a-outline a[aria-current="true"]::after { content: ' \25C2'; color: var(--key); }
}
.a-eof .caret { margin-left: 8px; }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

/* ---------- v3: slightly more agentic ----------
   The command types itself out, the page lists the tools it exposes, and the outline marks sections as read. */
.a-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 11.5px; color: var(--muted-2); }
.a-tools .k { margin-right: 2px; color: var(--key); }
.a-tools .k::after { content: ':'; color: var(--faint); }
.a-tools code { padding: 2px 7px; font-size: 11px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.a-outline-h .pct { margin-left: 8px; color: var(--faint); }
@media (min-width: 1240px) {
    .a-outline a.read { color: var(--faint); }
    .a-outline a.read .tree::after { content: ' \2713'; color: #2E8B57; }
}
