/* Paper, ink, and a small amount of motion.
   Stageshow references and attribution: DESIGN-SOURCES.md. */
:root {
    color-scheme: light;
    --bg: #fbfaf8;
    --ink: #2f2c29;
    --ink-soft: #6d6862;
    --ink-faint: #77716a;
    --rule: #e3dfd9;
    --rule-soft: #efece7;
    --link-ul: #b8b2aa;
    --accent: #b4553f;
    --measure: 608px;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-arrive: cubic-bezier(0.25, 0.8, 0.25, 1);
}
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141416;
    --ink: #ececef;
    --ink-soft: #aaa7ae;
    --ink-faint: #949098;
    --rule: #35343a;
    --rule-soft: #29282d;
    --link-ul: #69656f;
    --accent: #e08a72;
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #141416;
        --ink: #ececef;
        --ink-soft: #aaa7ae;
        --ink-faint: #949098;
        --rule: #35343a;
        --rule-soft: #29282d;
        --link-ul: #69656f;
        --accent: #e08a72;
    }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
html:has(.project-drawer[open]) { overflow: hidden; }
body {
    overflow-x: clip;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .9375rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
.wrap {
    max-width: var(--measure);
    margin-inline: auto;
    padding: max(76px, env(safe-area-inset-top)) 24px max(40px, env(safe-area-inset-bottom));
}
/* The reading column makes room for a focused second surface. */
.portfolio-page { transform-origin: left center; transition: transform 280ms var(--ease-out), opacity 240ms ease; }
html:has(.project-drawer[open]) .portfolio-page { transform: translateX(clamp(-240px, -17vw, -96px)) scale(.96); opacity: .5; }
p, li, dd { text-wrap: pretty; }
a, button, summary { touch-action: manipulation; }
a {
    color: inherit;
    text-decoration-color: var(--link-ul);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 160ms ease, text-decoration-color 160ms ease;
}
button { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { user-select: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--bg); }
.skip-link { position: absolute; left: -9999px; top: 12px; padding: 10px 16px; background: var(--ink); color: var(--bg); z-index: 10; }
.skip-link:focus { left: 12px; }
h1 { font-size: 1.125rem; font-weight: 500; line-height: 1.4; letter-spacing: -.025em; }
.role { color: var(--ink-soft); font-size: .8125rem; margin-top: 3px; }
.identity { display: flex; align-items: center; gap: 16px; }
.identity > div { min-width: 0; }
.profile-portrait { display: block; flex: none; width: 56px; height: 56px; }
.profile-portrait img { display: block; width: 100%; height: 100%; border-radius: 14px; image-rendering: pixelated; transition: transform 200ms var(--ease-out); }
.bio { margin-top: 25px; }
.bio p + p { margin-top: 15px; }
.bio .personal { color: var(--ink-soft); font-size: .875rem; }
.fans { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: 6px 0 0 -7px; }
.fans a { display: inline-grid; place-items: center; width: 36px; height: 36px; text-decoration: none; }
.fans img { width: 22px; height: 22px; object-fit: contain; opacity: .7; filter: grayscale(1) contrast(.95); transition: opacity 160ms ease, filter 240ms ease; }
html[data-theme="dark"] .fans img { filter: grayscale(1) brightness(2.4); }
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .fans img { filter: grayscale(1) brightness(2.4); }
}
.fans a:focus-visible img { opacity: 1; filter: none; }
.text-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 20px; font-size: .8125rem; }
.text-links a { display: inline-flex; align-items: center; min-height: 40px; }
.intro .text-links { margin-top: 13px; }
.selected-work { margin-top: 43px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 20px; margin-bottom: 5px; }
h2 { color: var(--ink-soft); font-size: .8125rem; font-weight: 400; line-height: 1.5; }
.archive-link { font-size: .75rem; color: var(--ink-soft); min-height: 36px; display: inline-flex; align-items: center; gap: 6px; }
.work-list { list-style: none; }
.work-list > li { border-top: 1px solid var(--rule-soft); }
.work-list > li:last-child { border-bottom: 1px solid var(--rule-soft); }
.work-link { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 14px; text-decoration: none; }
.work-copy { min-width: 0; }
.work-name { display: block; font-size: .875rem; font-weight: 500; line-height: 1.5; }
.work-description { display: block; color: var(--ink-soft); font-size: .8125rem; line-height: 1.55; margin-top: 3px; }
.link-arrow { display: inline-block; color: var(--ink-faint); font-size: 1rem; flex: none; transition: transform 160ms var(--ease-out), color 240ms ease; }
.availability { margin-top: 23px; color: var(--ink-soft); font-size: .8125rem; }
.tech-stack { margin-top: 36px; }
.stack-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 17px 8px; margin-top: 17px; list-style: none; }
.stack-list li { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; text-align: center; }
.stack-icon { display: grid; place-items: center; width: 52px; height: 52px; border: 1px dashed var(--rule); border-radius: 12px; color: var(--tech-brand, var(--ink)); background: var(--bg); }
.stack-icon svg { display: block; width: 25px; height: 25px; fill: currentColor; }
.stack-label { color: var(--ink-soft); font-size: .6875rem; line-height: 1.4; }
.page-footer { margin-top: 51px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink-faint); font-size: .75rem; }
.local-time { font-variant-numeric: tabular-nums; }
.local-time > span[aria-hidden] { padding-inline: 4px; }
/* Adapted from Stageshow States: both labels share one stable grid slot.
   Only the changing label moves, keeping the surrounding layout still. */
.theme-toggle {
    display: inline-grid;
    align-items: center;
    justify-items: end;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font-size: .75rem;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    transition: transform 160ms var(--ease-out), color 240ms ease;
}
.theme-state { grid-area: 1 / 1; opacity: 0; transform: translateY(4px); transition: opacity 100ms ease, transform 200ms var(--ease-out); }
.theme-toggle[data-next-theme="dark"] [data-theme-label="dark"],
.theme-toggle[data-next-theme="light"] [data-theme-label="light"] { opacity: 1; transform: translateY(0); transition-delay: 40ms; }
.theme-toggle:active { transform: scale(.97); }
/* A composition arrives once in reading order, then stays still. No library,
   scroll listeners, or persistent GPU layers. Content is visible without JS. */
@media (prefers-reduced-motion: no-preference) {
    [data-entry] { animation: arrive 480ms var(--ease-arrive) both; animation-delay: var(--entry-delay, 0ms); }
    @keyframes arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
}
@media (hover: hover) and (pointer: fine) {
    a:hover { color: var(--accent); text-decoration-color: var(--accent); }
    .work-link:hover .link-arrow { transform: translate(2px, -2px); color: var(--accent); }
    .theme-toggle:hover { color: var(--ink); }
    .proj > summary:hover .pname { color: var(--accent); }
    .fans a:hover img { opacity: 1; filter: none; }
    .drawer-close:hover { color: var(--accent); }
    .profile-portrait:hover img { transform: translateY(-2px) rotate(-4deg) scale(1.04); }
}
/* The browser owns modality, focus containment, Escape, and focus restoration.
   Discrete transitions retain the top layer through the closing motion. */
.project-drawer {
    position: fixed;
    inset: 48px max(24px, calc((100vw - 1120px) / 2)) auto auto;
    margin: 0;
    width: min(520px, calc(100% - 48px));
    height: calc(100% - 96px);
    height: min(820px, calc(100dvh - 96px));
    max-width: none;
    max-height: none;
    padding: 0;
    border: 1px solid var(--rule);
    border-radius: 16px;
    box-shadow: 0 16px 64px rgb(0 0 0 / .08), 0 2px 8px rgb(0 0 0 / .04);
    background: var(--bg);
    color: var(--ink);
    opacity: 0;
    transform: translateX(24px) scale(.98);
    transition: transform 280ms var(--ease-out), opacity 240ms ease, background-color 240ms ease, color 240ms ease, border-color 240ms ease, display 280ms allow-discrete, overlay 280ms allow-discrete;
}
.project-drawer[open] { opacity: 1; transform: translateX(0) scale(1); }
.project-drawer::backdrop {
    background: radial-gradient(ellipse at 78% 40%, transparent, rgb(0 0 0 / .12));
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 240ms ease, display 280ms allow-discrete, overlay 280ms allow-discrete;
}
.project-drawer[open]::backdrop { opacity: 1; }
@starting-style {
    .project-drawer[open] { opacity: 0; transform: translateX(24px) scale(.98); }
    .project-drawer[open]::backdrop { opacity: 0; }
}
.drawer-layout { display: flex; flex-direction: column; height: 100%; }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: max(27px, env(safe-area-inset-top)) 28px 22px; border-bottom: 1px solid var(--rule-soft); }
.drawer-header h2 { color: var(--ink); font-size: 1.0625rem; font-weight: 500; line-height: 1.4; }
.drawer-header p { color: var(--ink-soft); font-size: .8125rem; margin-top: 6px; }
.drawer-close { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: -8px; border: 0; background: transparent; color: var(--ink-soft); font-size: .8125rem; cursor: pointer; white-space: nowrap; }
.drawer-close span { font-size: 1.125rem; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 28px max(28px, env(safe-area-inset-bottom)); }
.drawer-body .projects { border-top: 0; }
.drawer-status, .drawer-fallback { margin-top: 16px; font-size: .8125rem; color: var(--ink-soft); }
.drawer-status:empty { display: none; }
html[data-input="keyboard"] .project-drawer,
html[data-input="keyboard"] .project-drawer::backdrop,
html[data-input="keyboard"] .portfolio-page { transition: none; }
/* Secondary pages share the same quiet reading column. */
.back-link { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: .8125rem; min-height: 40px; margin-bottom: 25px; text-decoration: none; }
.page-description { margin-top: 9px; color: var(--ink-soft); font-size: .875rem; }
.page-intro { margin-bottom: 33px; }
.end-links { margin-top: 28px; }
.projects { border-top: 1px solid var(--rule-soft); }
.proj { border-bottom: 1px solid var(--rule-soft); scroll-margin-top: 24px; }
.proj > summary { display: grid; grid-template-columns: minmax(0, 1fr) 14px; gap: 0 16px; padding-block: 16px; cursor: pointer; list-style: none; }
.proj > summary::-webkit-details-marker { display: none; }
.phead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.pname { font-size: .875rem; font-weight: 500; transition: color 160ms ease; }
.ptag { color: var(--ink-faint); font-size: .6875rem; }
.pline { grid-column: 1; color: var(--ink-soft); font-size: .8125rem; line-height: 1.55; margin-top: 3px; }
.chev { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--ink-faint); transition: transform 200ms var(--ease-out); }
.proj[open] > summary .chev { transform: rotate(180deg); }
.proj[open] > summary .pname { color: var(--accent); }
.proj.proj--offline > summary .pname { color: var(--ink-soft); }
.pbody { padding: 0 0 22px; color: var(--ink-soft); font-size: .8125rem; }
.pbody ul, .job ul { padding-left: 17px; margin-top: 10px; }
.pbody li + li, .job li + li { margin-top: 4px; }
.tech { margin-top: 10px; color: var(--ink-faint); font-size: .75rem; }
.plinks { display: flex; flex-wrap: wrap; gap: 2px 20px; margin-top: 9px; }
.plinks a { display: inline-flex; align-items: center; min-height: 36px; }
/* Native details provide keyboard and no-JS behavior. Supporting browsers
   ease the content and its neighbors together; older ones open instantly. */
@supports (interpolate-size: allow-keywords) and (content-visibility: hidden) {
    .proj { interpolate-size: allow-keywords; }
    .proj::details-content { block-size: 0; overflow: clip; opacity: 0; transition: block-size 240ms var(--ease-out), opacity 200ms ease, content-visibility 240ms allow-discrete; }
    .proj[open]::details-content { block-size: auto; opacity: 1; }
}
.resume-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; }
.linkbtn { border: 0; padding: 0; background: none; color: var(--ink-soft); font-size: .8125rem; cursor: pointer; min-height: 40px; text-decoration: underline; text-decoration-color: var(--link-ul); text-underline-offset: 3px; }
.resume-summary { margin-top: 21px; font-size: .875rem; }
.resume-contact { margin-top: 17px; color: var(--ink-soft); font-size: .8125rem; overflow-wrap: anywhere; }
.resume-content section { margin-top: 32px; }
.resume-content h2 { margin-bottom: 17px; border-bottom: 1px solid var(--rule); padding-bottom: 9px; }
.job + .job { margin-top: 25px; }
.job h3 { font-size: .875rem; font-weight: 500; line-height: 1.5; }
.when { display: block; color: var(--ink-faint); font-size: .75rem; font-weight: 400; margin-top: 3px; }
.org { font-size: .8125rem; color: var(--ink-soft); margin-top: 4px; }
.jline { font-size: .8125rem; margin-top: 10px; }
.job li, .resume-projects li { color: var(--ink-soft); font-size: .8125rem; }
.chip { font: inherit; }
.skills dt { font-size: .8125rem; font-weight: 500; margin-top: 13px; }
.skills dd { font-size: .8125rem; color: var(--ink-soft); line-height: 1.65; margin-top: 3px; }
.certs { list-style: none; font-size: .8125rem; color: var(--ink-soft); }
.certs li + li { margin-top: 10px; }
.certs strong, .resume-projects strong { color: var(--ink); font-weight: 500; }
.resume-projects { padding-left: 17px; }
.resume-projects li + li { margin-top: 8px; }
.resume-content .screen-only { margin-top: 13px; font-size: .8125rem; }
html[data-input="keyboard"] .theme-state,
html[data-input="keyboard"] .theme-toggle,
html[data-input="keyboard"] .chev,
html[data-input="keyboard"] .proj::details-content { transition: none; }
/* Enabled after first paint: saved themes still apply instantly on arrival.
   Animate the painted colors, rather than a screenshot or an overlay of text. */
html[data-theme-ready] :where(body, a, .role, .bio .personal, h2, .work-description, .availability, .stack-icon, .stack-label, .page-footer, .drawer-header p, .drawer-close, .drawer-status, .drawer-fallback, .page-description, .ptag, .pline, .pbody, .tech, .resume-contact, .when, .org, .job li, .resume-projects li, .skills dd, .certs, .certs strong, .resume-projects strong) {
    transition: background-color 240ms ease, color 240ms ease, text-decoration-color 240ms ease;
}
html[data-theme-ready] :where(.work-list > li, .drawer-header, .projects, .proj, .resume-content h2) { transition: border-color 240ms ease; }
html[data-theme-ready] .stack-icon { transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease; }
@media (max-width: 700px) {
    .project-drawer { inset: max(16px, env(safe-area-inset-top)) 16px auto; width: calc(100% - 32px); height: calc(100% - 32px); height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom))); }
    html:has(.project-drawer[open]) .portfolio-page { transform: translateX(-32px) scale(.96); }
}
@media (max-width: 480px) {
    .wrap { padding: max(39px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); }
    .selected-work { margin-top: 34px; }
    .page-footer { margin-top: 34px; }
    .work-link { gap: 14px; }
    .drawer-header { padding-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right)); }
    .drawer-body { padding-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right)); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .theme-state, .link-arrow, .profile-portrait img, .portfolio-page, .project-drawer { transform: none !important; }
    html[data-theme-ready] :where(body, a, .role, .bio .personal, h2, .work-description, .availability, .page-footer, .drawer-close) { transition: color 160ms ease, background-color 160ms ease !important; }
    .project-drawer, .project-drawer::backdrop, .portfolio-page { transition: opacity 160ms ease !important; }
}
@page { size: letter; margin: 14mm 16mm; }
@media print {
    html, html[data-theme] { color-scheme: light; --bg: #fff; --ink: #000; --ink-soft: #222; --ink-faint: #444; --rule: #aaa; --rule-soft: #ccc; --accent: #000; }
    html { font-size: 12px; }
    body { background: white; color: black; line-height: 1.4; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .wrap { max-width: none; padding: 0; transform: none !important; opacity: 1 !important; }
    .skip-link, .page-footer, .back-link, .js-print, .end-links, .screen-only, .chev, .fans, .tech-stack, .project-drawer { display: none !important; }
    h1 { font-size: 18pt; }
    h2 { color: black; }
    a { text-decoration: none; }
    .resume-intro { margin-bottom: 10pt; }
    .resume-summary, .resume-contact { margin-top: 7pt; }
    .resume-content section { margin-top: 12pt; }
    .resume-content h2 { margin-bottom: 6pt; padding-bottom: 3pt; }
    .job + .job { margin-top: 9pt; }
    .job, .resume-projects li, .certs li { break-inside: avoid; }
    .job h3 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
    .when { margin-top: 0; }
    .jline { margin-top: 4pt; }
    .job ul { margin-top: 4pt; }
    .tech { margin-top: 3pt; }
    .skills dt { margin-top: 6pt; break-after: avoid; }
    .skills dd { margin-top: 1pt; }
    .resume-projects a::after, .resume-contact a:not([href^="mailto:"])::after, .plinks a::after { content: " (" attr(href) ")"; font-size: .9em; overflow-wrap: anywhere; }
    .proj { break-inside: avoid; }
    .proj::details-content { content-visibility: visible; block-size: auto; overflow: visible; opacity: 1; }
    .pbody { padding-bottom: 9pt; }
    .plinks a { min-height: 0; }
}
/* GitHub activity (built by script.js from public contribution data). */
.activity { margin-top: 40px; }
/* ── GitHub activity (built by script.js from public data) ── */

.gh { margin-top: 12px; }
.gh-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--rule) transparent;
    padding: 4px 4px 6px;
    margin: 0 -4px;
    outline: none;
}
.gh-months, .gh-grid {
    --cell: 8px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(var(--cell), 1fr);
    gap: 2px;
    min-width: calc(53 * var(--cell) + 52 * 2px);
}
.gh-months { font-size: .6875rem; color: var(--ink-faint); height: 1.4em; margin-bottom: 4px; }
.gh-months span { white-space: nowrap; overflow: visible; }
.gh-grid { grid-template-rows: repeat(7, auto); }
.gh-grid:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.gh-c {
    display: block;
    aspect-ratio: 1;
    border-radius: 2px;
    background: var(--gh-0);
    transition: background-color .5s cubic-bezier(.16,1,.3,1), transform .15s ease;
}
.gh-c[data-l="1"] { background: var(--gh-1); }
.gh-c[data-l="2"] { background: var(--gh-2); }
.gh-c[data-l="3"] { background: var(--gh-3); }
.gh-c[data-l="4"] { background: var(--gh-4); }
.gh-c.is-today { box-shadow: 0 0 0 1.5px var(--accent); }
.gh-c.is-on { box-shadow: 0 0 0 1.5px var(--accent); transform: scale(1.25); position: relative; z-index: 1; }
html[data-input="keyboard"] .gh-c { transition: none; }
.gh-c.is-pad { visibility: hidden; }
/* Fill-in: cells start blank and take their colour week by week, once. */
.gh.is-wait .gh-c:not(.is-pad) { background: var(--gh-0); }

/* Ink, not accent: the map reads as a greyscale density of the year. */
.gh { --gh-0: var(--rule-soft); --gh-1: color-mix(in srgb, var(--ink) 22%, var(--bg));
      --gh-2: color-mix(in srgb, var(--ink) 42%, var(--bg)); --gh-3: color-mix(in srgb, var(--ink) 66%, var(--bg));
      --gh-4: var(--ink); }

.gh-tip { min-height: 1.6em; margin-top: 6px; font-size: .8125rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.gh figcaption {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
    font-size: .8125rem; color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
.gh-total strong { color: var(--ink); font-weight: 600; }
.gh-legend { display: inline-flex; align-items: center; gap: 3px; font-size: .6875rem; color: var(--ink-faint); }
.gh-legend i { width: 9px; height: 9px; border-radius: 2px; background: var(--gh-0); }
.gh-legend i[data-l="1"] { background: var(--gh-1); } .gh-legend i[data-l="2"] { background: var(--gh-2); }
.gh-legend i[data-l="3"] { background: var(--gh-3); } .gh-legend i[data-l="4"] { background: var(--gh-4); }
.gh-legend i:first-of-type { margin-left: 3px; } .gh-legend i:last-of-type { margin-right: 3px; }
.gh-push { margin-top: 4px; font-size: .8125rem; color: var(--ink-soft); }
.gh-scope { margin-top: 6px; font-size: .75rem; color: var(--ink-soft); }
/* Hobby scenes: the words in the personal line play a background animation
   (scenes.js). Without JS they read as plain text. */
.hobby { display: inline; border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: default; }
html.has-scenes .hobby {
    display: inline-block;
    min-height: 32px;
    line-height: 32px;
    cursor: pointer;
    color: var(--ink);
    text-decoration: underline dotted;
    text-decoration-color: var(--link-ul);
    text-underline-offset: 3px;
    transition: color 160ms ease, text-decoration-color 160ms ease;
}
html.has-scenes .bio .personal { line-height: 2.4; }
.bio .scene-hint { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; font-size: .75rem; line-height: 1.6; color: var(--ink-faint); }
.scene-hint-arrow { flex: none; font-size: 1rem; line-height: 1; }
html.has-scenes .hobby[aria-pressed="true"] { color: var(--accent); text-decoration-style: solid; text-decoration-color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
    html.has-scenes .hobby:hover { color: var(--accent); text-decoration-color: var(--accent); }
    .scene-stop:hover { color: var(--accent); }
}
.portfolio-page { position: relative; z-index: 1; }
.scene-canvas { --scene-strength: 1; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 200ms var(--ease-out); }
.scene-canvas.is-on { opacity: var(--scene-strength); }
.scene-canvas.has-envelope { transition: none; }
.scene-caption {
    position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom), var(--scene-footer-clearance, 0px)); z-index: 2;
    display: flex; align-items: center; gap: 12px; transform: translateX(-50%);
    padding: 4px 6px 4px 14px; border: 1px solid var(--rule); border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    color: var(--ink-soft); font-size: .75rem; font-variant-numeric: tabular-nums;
    width: max-content;
    max-width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
}
.scene-name { min-width: 0; overflow-wrap: anywhere; }
.scene-stop { flex-shrink: 0; }
.scene-name { color: var(--ink); }
.scene-stop { border: 0; background: none; color: var(--ink-soft); font-size: .75rem; min-height: 44px; padding: 0 8px; cursor: pointer; }
@media print { .scene-canvas, .scene-caption, .activity { display: none !important; } }
/* All scenes stay behind the page. Protect the reading column without dimming
   content or intercepting navigation, text selection, or scrolling. */
.scene-canvas {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(50% - 340px), rgb(0 0 0 / .14) calc(50% - 300px), rgb(0 0 0 / .14) calc(50% + 300px), #000 calc(50% + 340px));
    mask-image: linear-gradient(90deg, #000 calc(50% - 340px), rgb(0 0 0 / .14) calc(50% - 300px), rgb(0 0 0 / .14) calc(50% + 300px), #000 calc(50% + 340px));
}
@media (max-width: 1099px) {
    .scene-canvas {
        --scene-strength: .6;
        -webkit-mask-image: linear-gradient(90deg, #000, rgb(0 0 0 / .35) 20%, rgb(0 0 0 / .35) 80%, #000);
        mask-image: linear-gradient(90deg, #000, rgb(0 0 0 / .35) 20%, rgb(0 0 0 / .35) 80%, #000);
    }
}
.scene-canvas.is-pixel { image-rendering: pixelated; }
html.has-scenes .hobby:active { color: var(--accent); }
.hobby { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (prefers-reduced-motion: reduce) { .portfolio-page, .scene-canvas { transition: none; } }
