/* Plain type, one reading column, and system fonts. */
:root {
    color-scheme: light;
    --bg: #faf9f6;
    --text: #252523;
    --muted: #656560;
    --border: #deded7;
    --surface: #efeee8;
    --link-hover: #225da8;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #1c1c1b;
        --text: #e8e8e2;
        --muted: #a4a49b;
        --border: #3b3b37;
        --surface: #292927;
        --link-hover: #93bdf2;
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1c1c1b;
    --text: #e8e8e2;
    --muted: #a4a49b;
    --border: #3b3b37;
    --surface: #292927;
    --link-hover: #93bdf2;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
/* Keep text colors immediate so theme changes never flash low-contrast links. */
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); transition: text-decoration-color 160ms ease; }
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.container { max-width: 720px; margin: 0 auto; padding: 88px 28px 40px; opacity: var(--felt-site-opacity, 1); }
header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 64px; }
.site-name { display: inline-flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.profile-photo { display: block; flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.site-identity { display: inline-flex; align-items: center; gap: 12px; }
.portrait-trigger { display: block; flex: none; width: 48px; height: 48px; border: 0; padding: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.portrait-trigger:disabled { cursor: default; }
/* The canvas takes over the same portrait; never leave a second copy behind. */
.portrait-trigger[aria-expanded="true"]:not([aria-busy="true"]) .profile-photo { visibility: hidden; }
.intro p { text-wrap: pretty; }
.keep-together { white-space: nowrap; }
nav { display: flex; flex-wrap: wrap; gap: 20px; font-size: 15px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--link-hover); }
nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }
nav a[aria-current="page"]:hover { color: var(--link-hover); }
main { min-height: 200px; overflow-wrap: break-word; }
header, main, footer { animation: enter 360ms cubic-bezier(0.16, 1, 0.3, 1) both; }
main { animation-delay: 45ms; }
footer { animation-delay: 90ms; }
@keyframes enter {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

p { margin: 0 0 1.2em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.3; }
h1 { font-size: 25px; margin: 0 0 28px; }
h2 { font-size: 21px; margin: 1.8em 0 0.6em; }
h3 { font-size: 18px; margin: 1.6em 0 0.6em; }
.empty-state, .post-meta, .thought-date, .thought-summary { color: var(--muted); }
.thought-item { margin-bottom: 32px; }
.thought-title { font-size: 19px; font-weight: 500; }
.thought-date, .post-meta { font-size: 14px; margin-top: 5px; }
.thought-summary { font-size: 16px; margin-top: 8px; }
.post-meta { margin: -16px 0 32px; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body blockquote { border-left: 2px solid var(--border); margin: 24px 0; padding-left: 20px; color: var(--muted); }
.post-body code { background: var(--surface); padding: 2px 4px; font-size: 0.9em; }
.post-body pre { overflow-x: auto; padding: 16px; background: var(--surface); }
.post-body pre code { padding: 0; }
.post-body img { max-width: 100%; height: auto; }
.back-link { display: inline-block; margin-top: 32px; font-size: 15px; }
.experiment-list { list-style: none; padding: 0; margin: 0; }
.experiment-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.experiment-item:first-child { padding-top: 0; }
.experiment-name { font-size: 17px; font-weight: 500; }
.experiment-status { color: var(--muted); font-size: 13px; align-self: baseline; }
.experiment-desc { grid-column: 1 / -1; color: var(--muted); font-size: 15px; }
footer { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 20px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.socials { display: flex; flex-wrap: wrap; gap: 18px; }
.social-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--muted); text-decoration: none; }
.social-icon { flex: none; }
.social-link span { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: transparent; transition: text-decoration-color 160ms ease; }
.social-link:hover, .social-link:focus-visible { color: var(--link-hover); }
.social-link:hover span, .social-link:focus-visible span { text-decoration-color: currentColor; }

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 78px; min-height: 32px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; line-height: 1; cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease; }
.theme-toggle:hover { color: var(--text); background: var(--surface); border-color: var(--muted); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle[data-next-theme="light"] .icon-moon { display: none; }
.theme-toggle[data-next-theme="light"] .icon-sun { display: block; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 20px; top: 12px; background: var(--bg); padding: 8px; }
@media (max-width: 600px) {
    .container { padding: 40px 24px 32px; }
    header { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 40px; }
    nav { gap: 24px; }
    footer { margin-top: 48px; }
}
@media (pointer: coarse) {
    .theme-toggle, .social-link { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    header, main, footer { animation: none; }
    a, nav a, .social-icon, .social-link span, .theme-toggle { transition: none; }
    .social-link:hover .social-icon { transform: none; }
}

/* The scene lives outside the reading column and is absent until invited in. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.felt-world { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; overscroll-behavior: contain; }
.felt-world::backdrop { background: transparent; }
.felt-world[open] { display: block; }
.felt-objects { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.felt-objects[hidden] { display: none; }
.felt-object { position: absolute; margin: 0; padding: 0; border: 0; border-radius: 12px; background: transparent; color: #30382b; opacity: 0; pointer-events: none; }
.felt-object:focus-visible { opacity: 1; outline: 3px solid #fff9d9; box-shadow: 0 0 0 5px #3c513c; }
.felt-object span { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 170px; padding: 6px 10px; border-radius: 8px; background: #faf9f0; font: 13px/1.3 system-ui, sans-serif; }
.felt-stage { position: absolute; inset: 0; overflow: hidden; will-change: clip-path; }
#felt-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#felt-canvas.dragging { cursor: grabbing; }
#felt-canvas[data-interactive="true"]:not(.dragging) { cursor: pointer; }
.felt-world[data-overview="true"] #felt-canvas { cursor: crosshair; }
.felt-controls { position: absolute; z-index: 2; bottom: max(20px, env(safe-area-inset-bottom)); right: max(20px, env(safe-area-inset-right)); display: flex; align-items: flex-end; flex-direction: column; gap: 8px; }
.felt-controls[hidden], .felt-destinations[hidden] { display: none; }
.felt-destinations { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 620px; }
.felt-destinations button { min-height: 44px; padding: 8px 14px; border: 1px solid #5c6453; border-radius: 24px; background: #faf9f0; color: #30382b; font: 14px/1.2 system-ui, sans-serif; cursor: pointer; }
.felt-destinations button:focus-visible { outline: 3px solid #30382b; outline-offset: 2px; }
.felt-world[data-overview="true"] .felt-controls { left: 16px; right: 16px; }
.felt-destinations { align-self: center; }
@media (max-width: 600px) { .felt-destinations { max-width: 340px; } }
.felt-corner { display: flex; align-items: center; gap: 4px; position: relative; }
.felt-settings { position: static; }
.felt-light { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 78px; min-height: 44px; padding: 8px 12px; border: 1px solid rgba(45,49,39,.2); border-radius: 999px; background: rgba(250,249,240,.9); color: #30382b; font: 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; }
.felt-light .icon-sun { display: none; }
.felt-light[data-next-light="day"] .icon-moon { display: none; }
.felt-light[data-next-light="day"] .icon-sun { display: block; }
.felt-light:focus-visible { outline: 2px solid #30382b; outline-offset: 4px; }
.felt-settings summary { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; list-style: none; cursor: pointer; color: #fffdf0; font: 26px/1 system-ui, sans-serif; text-shadow: 0 1px 4px #30382b, 0 0 2px #30382b; opacity: .7; }
.felt-settings summary::-webkit-details-marker { display: none; }
.felt-settings summary:hover, .felt-settings summary:focus-visible, .felt-settings[open] summary { opacity: 1; }
.felt-settings summary:focus-visible { outline: 2px solid #fffdf0; outline-offset: -4px; border-radius: 50%; }
.felt-settings .felt-tools { position: absolute; right: 0; bottom: 52px; }
.felt-settings:not([open]) .felt-tools { display: none; }
.felt-tools { display: flex; white-space: nowrap; padding: 3px; border: 1px solid rgba(45,49,39,.2); border-radius: 25px; background: rgba(250,249,240,.96); box-shadow: 0 2px 8px rgba(25,34,20,.12); }
.felt-tools button { min-width: 44px; min-height: 44px; padding: 6px 12px; border: 0; border-radius: 22px; background: transparent; color: #30382b; font: 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; }
.felt-tools button:hover { background: #e7e9dc; }
.felt-tools button:focus-visible { outline: 2px solid #30382b; outline-offset: 0; }
.felt-tools button:disabled { opacity: .65; cursor: default; }
.felt-loading { position: fixed; left: 20px; bottom: 20px; z-index: 2; width: auto; height: auto; max-width: calc(100% - 40px); margin: 0; padding: 10px 14px; clip-path: none; white-space: normal; border-radius: 12px; background: var(--surface); color: var(--text); font-size: 14px; }
.portrait-trigger[aria-busy="true"] { outline: 2px dashed var(--muted); outline-offset: 4px; }
@media (max-width: 600px) { .felt-controls { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); } }
@media (max-width: 380px) { .felt-tools button { padding-inline: 9px; font-size: 13px; } }
.felt-world[data-night="true"] .felt-tools,
.felt-world[data-night="true"] .felt-light,
.felt-world[data-night="true"] .felt-return,
.felt-world[data-night="true"] .felt-destinations button { background: #283343; color: #eee6d0; border-color: #7e8b99; }
.felt-world[data-night="true"] .felt-tools button { color: #eee6d0; }
.felt-world[data-night="true"] .felt-tools button:hover { background: #3b4859; }
.felt-world[data-night="true"] :is(.felt-tools button,.felt-light,.felt-return,.felt-destinations button):focus-visible { outline-color: #eee6d0; }
.felt-return { position: absolute; z-index: 2; top: max(20px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 14px; border: 1px solid rgba(45, 49, 39, .2); border-radius: 999px; background: rgba(250, 249, 240, .9); color: #30382b; font: 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; opacity: 0; pointer-events: none; transition: background-color 120ms ease; }
.felt-world[data-state="entering"] .felt-return,
.felt-world[data-state="open"] .felt-return { opacity: 1; pointer-events: auto; }
.felt-return:hover { background: #faf9f0; }
.felt-return:focus-visible { outline: 2px solid #30382b; outline-offset: 4px; }
@media (max-width: 600px) {
    /* Keep the return control clear of the portrait's upper-left departure. */
    .felt-return { left: auto; right: max(20px, env(safe-area-inset-right)); }
}
@media (prefers-reduced-motion: reduce) {
    .felt-return { transition: none; }
    .felt-stage { will-change: auto; }
}
