/* =====================================================================
   Anthropic-inspired Editorial Research theme. Loaded after style.css & main.css.
   Warm alabaster paper (#FAF9F5), deep charcoal ink (#141413), parchment (#F0EEE6),
   and terracotta clay (#D97757) in Light mode; warm charcoal in Dark mode.
   Type: Newsreader (display serif), IBM Plex Sans (text & UI), IBM Plex Mono (captions).
   ===================================================================== */

@view-transition { navigation: auto; }

html,
html[data-theme="light"] {
    --bg: #faf9f5;
    --panel: #ffffff;
    --surface: #f0eee6;
    --ink: #141413;
    --sub: #5e5d59;
    --accent: #d97757;
    --accent-2: #52738c;
    --link: #c25e3e;
    --grid: rgba(20, 20, 19, 0.05);
    --hi: #141413;
    --hot: #d97757;
    --mint: #4e7a5b;
    --violet: #785e7a;
    --sun: #b8863b;
    --ok: #4e7a5b;
    --on-hi: #faf9f5;
    --border-col: rgba(20, 20, 19, 0.12);
    --shadow-col: rgba(20, 20, 19, 0.08);
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #141413;
    --panel: #1f1e1c;
    --surface: #272623;
    --ink: #faf9f5;
    --sub: #a8a69e;
    --accent: #e08365;
    --accent-2: #7ba1bd;
    --link: #e59277;
    --grid: rgba(250, 249, 245, 0.06);
    --hi: #faf9f5;
    --hot: #e08365;
    --mint: #6fa37e;
    --violet: #a589a8;
    --sun: #d4a459;
    --ok: #6fa37e;
    --on-hi: #141413;
    --border-col: rgba(250, 249, 245, 0.13);
    --shadow-col: rgba(0, 0, 0, 0.42);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme]) {
        --bg: #141413; --panel: #1f1e1c; --surface: #272623; --ink: #faf9f5; --sub: #a8a69e;
        --accent: #e08365; --accent-2: #7ba1bd; --link: #e59277; --grid: rgba(250, 249, 245, 0.06);
        --hi: #faf9f5; --hot: #e08365; --mint: #6fa37e; --violet: #a589a8; --sun: #d4a459;
        --ok: #6fa37e; --on-hi: #141413;
        --border-col: rgba(250, 249, 245, 0.13); --shadow-col: rgba(0, 0, 0, 0.42);
    }
}

html, html[data-theme] {
    --paper: var(--panel);
    --ink-muted: var(--sub);
    --mono: var(--mono-font-family);
    --color-bg-main: var(--bg);
    --color-bg-sub: var(--panel);
    --color-text-main: var(--ink);
    --color-text-sub: var(--sub);
    --color-text-link: var(--link);
    --color-border-dark: var(--border-col);
    --color-border: var(--border-col);
    --color-border-light: color-mix(in srgb, var(--ink) 10%, transparent);
    --primary-font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --secondary-font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
    --mono-font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --edge: 1px solid var(--border-col);
    --drop: 0 8px 24px -16px var(--shadow-col);
    --measure: 41rem;
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

/* ---- Base + Subtle Ambient Canvas Layer ---- */
body {
    font-family: var(--primary-font-family);
    color: var(--ink);
    background-color: var(--bg);
    background-image: none;
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

.attention-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

main {
    position: relative;
    z-index: 1;
}

html[data-overclock="on"] body {
    background-image:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%);
}

html[data-overclock="on"]::after {
    content: "OVERCLOCK · 2.0X";
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 44;
    font: 500 0.62rem/1 var(--mono-font-family);
    letter-spacing: 0.08em;
    padding: 0.42rem 0.65rem;
    border-radius: 6px;
    background: #141413;
    color: #e08365;
    border: 1px solid rgba(224, 131, 101, 0.5);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--ink); }

h1, h2, h3, h4, h5, h6, .jumbo {
    font-family: var(--secondary-font-family);
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.02em;
}

a { color: var(--link); }
:focus-visible { outline: 2.5px solid var(--hot); outline-offset: 3px; border-radius: 5px; }
kbd {
    font-family: var(--mono-font-family); font-size: 0.72em;
    border: 1px solid currentColor; border-radius: 4px; padding: 0.05em 0.38em;
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 60; background: var(--hi); color: var(--on-hi); padding: 0.5rem 0.8rem; border: var(--edge); }

/* ---- Layout shell ---- */
.section { padding: 2rem 1.5rem 4rem; }
.columns { margin: 0; }
.column.shell { flex: none; width: 100%; max-width: 46rem; padding: 0; }
.column.shell--wide { max-width: 74rem; }

/* ---- Top bar ---- */
.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; flex-direction: row; align-items: center; gap: 0.55rem 1.2rem; flex-wrap: nowrap;
    padding: 0.75rem max(1.5rem, calc((100% - 74rem) / 2));
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
    backdrop-filter: blur(10px);
}
.topbar__brand {
    font-family: var(--secondary-font-family); font-weight: 500; font-size: 1.18rem;
    color: var(--ink); text-decoration: none; letter-spacing: -0.015em;
    margin-right: auto; white-space: nowrap;
}
.topbar__brand:hover { color: var(--accent); }
.topbar__nav { display: flex; gap: 0.25rem; width: auto; flex: none; margin: 0; padding: 0; }
.topbar__nav a, .tool {
    font-family: var(--primary-font-family); font-size: 0.84rem; font-weight: 500;
    letter-spacing: -0.005em; text-transform: none; text-decoration: none;
    color: var(--sub); padding: 0.45rem 0.72rem; border: 1px solid transparent; border-radius: 7px;
    background: none; cursor: pointer; line-height: 1; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 0.42rem;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.topbar__nav a:hover, .tool:hover { background: var(--surface); color: var(--ink); }
.topbar__nav a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; border-color: var(--border-col); }
.topbar__tools { display: flex; align-items: center; gap: 0.35rem; flex: none; }
.topbar a[href^="http"] { background-image: none; padding-right: 0.45rem; }
.tool { font-size: 0.78rem; border-color: var(--border-col); background: var(--panel); color: var(--ink); }
.tool[aria-pressed="true"] { border-color: var(--accent); }
.tool--sfx[aria-pressed="true"] { background: var(--hi); color: var(--on-hi); border-color: var(--hi); }
.tool__lamp { width: 0.54rem; height: 0.54rem; border-radius: 50%; background: var(--accent); }
html[data-theme="dark"] .tool__lamp { background: transparent; box-shadow: inset -2.5px -1.5px 0 var(--accent); }
.tool__wave {
    width: 0.48rem; height: 0.48rem; border-radius: 50%;
    border: 1.5px solid currentColor; opacity: 0.6;
}
.tool--sfx[aria-pressed="true"] .tool__wave { background: currentColor; opacity: 1; }
.tool--icon { padding: 0.45rem; border-color: transparent; background: none; color: var(--sub); }
.tool--icon:hover { color: var(--ink); background: var(--surface); }
.tool--icon svg { width: 16px; height: 16px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-family: var(--primary-font-family); font-size: 0.88rem; font-weight: 500;
    letter-spacing: -0.005em; text-transform: none; line-height: 1;
    padding: 0.78rem 1.2rem; border-radius: 8px; text-decoration: none; cursor: pointer;
    border: 1px solid var(--hi); background: var(--hi); color: var(--on-hi);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s cubic-bezier(.16, 1, .3, 1);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #ffffff; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--border-col); }
.btn--ghost:hover { background: var(--surface); color: var(--ink); border-color: color-mix(in srgb, var(--ink) 28%, transparent); }

/* ---- Hero shared text ---- */
.label {
    font-family: var(--mono-font-family); font-size: 0.68rem; font-weight: 500;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--sub);
}
.home-hero__name {
    font-size: clamp(2.8rem, 5.2vw, 4.5rem);
    font-weight: 500; line-height: 1.04; letter-spacing: -0.025em;
    margin: 0 0 1.25rem; padding: 0; text-wrap: balance;
}
.hero-word { display: inline-block; white-space: nowrap; }
.hero-char { display: inline-block; transition: color 0.16s ease; }
.hero-char:hover { color: var(--accent); }
.home-hero__headline {
    font-family: var(--secondary-font-family); font-weight: 400;
    font-size: clamp(1.22rem, 1.75vw, 1.52rem); line-height: 1.42;
    color: var(--ink); max-width: 39rem; margin: 0 0 1.15rem;
}
.home-hero__intro { font-size: 1.02rem; line-height: 1.74; color: var(--sub); max-width: var(--measure); margin: 0 0 1.9rem; }
.home-hero__intro em { font-family: var(--secondary-font-family); font-style: italic; color: var(--ink); font-weight: 500; text-decoration: none; }
.home-hero__actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-bottom: 1.6rem; }
.social-row { display: flex; gap: 1rem 1.25rem; flex-wrap: wrap; align-items: center; }
.social-row a { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; color: var(--sub); text-decoration: none; }
.social-row a:hover { color: var(--ink); }
.social-row svg { width: 16px; height: 16px; }
.social-row__loc { font-family: var(--mono-font-family); font-size: 0.68rem; letter-spacing: 0.03em; color: var(--sub); }

/* ---- Floating Sentinel Orb Mascot ---- */
.bot__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bot__head { fill: #1f1e1c; stroke: #d97757; stroke-width: 2; }
.bot__visor { fill: #141413; stroke: rgba(250, 249, 245, 0.22); stroke-width: 1.2; }
.bot__pupil { fill: #faf9f5; transition: transform 0.08s linear, fill 0.2s ease; }
.bot__line, .bot__mouth { stroke: #d97757; stroke-width: 2; fill: none; stroke-linecap: round; }
.bot__bulb { fill: #d97757; stroke: #1f1e1c; stroke-width: 1.4; }
html[data-overclock="on"] .bot__pupil,
html[data-overclock="on"] .bot__head { stroke: #e08365; }
html[data-overclock="on"] .bot__pupil { fill: #e08365; }

.mascot {
    position: fixed; right: 1.15rem; bottom: 1.15rem; z-index: 45;
    width: 56px; height: 56px; padding: 5px; border: 0; border-radius: 50%; cursor: pointer;
    background: conic-gradient(var(--accent) calc(var(--p, 0) * 1turn), color-mix(in srgb, var(--ink) 14%, var(--bg)) 0);
    box-shadow: 0 10px 24px -10px var(--shadow-col);
    transition: transform 0.22s cubic-bezier(.16, 1, .3, 1);
}
.mascot::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #1f1e1c; border: 1px solid rgba(217, 119, 87, 0.45); }
.mascot .bot__svg { position: relative; }
.mascot:hover { transform: translateY(-3px) scale(1.03); }
.mascot__say {
    position: absolute; right: 100%; bottom: 11px; margin-right: 10px;
    white-space: nowrap; pointer-events: none;
    font-family: var(--mono-font-family); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.02em;
    background: #141413; color: #faf9f5; border: 1px solid rgba(217, 119, 87, 0.45); border-radius: 6px; padding: 0.4rem 0.65rem;
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.35);
    opacity: 0; transform: translateX(6px) scale(0.95); transition: opacity 0.16s ease, transform 0.16s ease;
}
.mascot:hover .mascot__say, .mascot:focus-visible .mascot__say, .mascot.cheer .mascot__say { opacity: 1; transform: none; }

/* ---- Home sections ---- */
.home-section { margin-top: 4.25rem; }
.home-section__head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    border-bottom: 1px solid var(--border-col); padding-bottom: 0.75rem; margin-bottom: 0.5rem;
}
.home-section__title { font-size: clamp(1.38rem, calc(1.1rem + 0.9vw), 1.85rem); font-weight: 500; margin: 0; padding: 0; }
.home-section__more { font-family: var(--primary-font-family); font-size: 0.84rem; font-weight: 500; color: var(--sub); text-decoration: none; white-space: nowrap; }
.home-section__more:hover { color: var(--accent); }

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.45s ease, transform 0.45s cubic-bezier(.2, .9, .3, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- Writing list ---- */
.writing-item {
    position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
    padding: 0.95rem 0.65rem; border-bottom: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
    text-decoration: none; transition: background 0.18s ease;
    border-radius: 6px;
}
.writing-item::before {
    content: ""; position: absolute; left: 0.45rem; top: 50%; width: 0.44rem; height: 0.44rem; margin-top: -0.22rem;
    background: var(--accent); border-radius: 50%;
    transform: scale(0); transition: transform 0.2s cubic-bezier(.16, 1, .3, 1);
}
.writing-item:hover, .writing-item:focus-visible {
    background: radial-gradient(320px circle at var(--mx, 30%) 50%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%);
}
.writing-item:hover::before, .writing-item:focus-visible::before { transform: scale(1); }
.writing-item__title { font-family: var(--primary-font-family); font-weight: 600; font-size: 1.02rem; line-height: 1.38; color: var(--ink); transition: transform 0.18s cubic-bezier(.16, 1, .3, 1); }
.writing-item:hover .writing-item__title, .writing-item:focus-visible .writing-item__title { transform: translateX(0.85rem); }
.writing-item__date { font-family: var(--mono-font-family); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--sub); white-space: nowrap; }
.writing-item[hidden] { display: none; }

.filter {
    width: 100%; font: 500 1rem var(--primary-font-family) !important; color: var(--ink);
    background: var(--panel); border: var(--edge); border-radius: 8px; box-shadow: var(--drop);
    padding: 0.8rem 1rem; margin-bottom: 0.4rem;
}
.filter::placeholder { color: var(--sub); font-family: var(--primary-font-family) !important; }
.filter__count { margin: 0.6rem 0 0.6rem; min-height: 1em; }

/* ---- Cards (garden, backlinks) ---- */
.garden-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.15rem; margin-top: 1.25rem; perspective: 900px; }
.garden-card, .notelist-feed, .related-group {
    position: relative; display: block; padding: 1.15rem 1.25rem; text-decoration: none; overflow: hidden;
    background: var(--panel); border: var(--edge); border-radius: 10px; box-shadow: var(--drop);
    transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.garden-card::after, .notelist-feed::after, .related-group::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 72%);
    transition: opacity 0.2s ease;
}
.garden-card:hover::after, .notelist-feed:hover::after, .related-group:hover::after { opacity: 1; }
.notelist-feed { margin-bottom: 1.15rem; }
.garden-card:hover, .notelist-feed:hover, .related-group:hover {
    border-color: var(--accent);
    box-shadow: 0 16px 32px -14px var(--shadow-col);
    background: var(--panel); text-decoration: none;
}
.garden-card h6, .notelist-feed h6, .related-group h6 { font-size: 1.08rem; font-weight: 500; color: var(--ink); margin: 0 0 0.45rem; padding: 0; }
.garden-card p, .notelist-feed .excerpt { font-size: 0.9rem; line-height: 1.55; color: var(--sub); margin: 0; }
.notelist-feed a, .related-group a { text-decoration: none; }
.related-wrapper { perspective: 900px; }

/* ---- Feed and static page heads ---- */
.jumbo, h1.jumbo { font-size: clamp(2.25rem, calc(1.4rem + 3.2vw), 3.6rem); font-weight: 500; line-height: 1.06; letter-spacing: -0.025em; margin: 0.4rem 0 1.2rem; padding: 0; }
.feed-lead, .about-lead { font-size: 1.12rem; line-height: 1.62; color: var(--sub); max-width: var(--measure); margin-bottom: 1.8rem; }
.about-lead { color: var(--ink); font-weight: 500; }
.meta-title, .meta-title a, .meta-title h5, a.back {
    font-family: var(--mono-font-family); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--sub); text-decoration: none;
}
.meta-title a:hover, a.back:hover { color: var(--accent); }
a.back { display: inline-block; margin-bottom: 1rem; }

#search-input {
    font-family: var(--primary-font-family) !important; color: var(--ink);
    background: var(--panel); border: var(--edge); border-radius: 8px; box-shadow: var(--drop);
}
#search-input::placeholder { color: var(--sub); font-family: var(--primary-font-family) !important; }
.search-results { background: var(--panel); border-radius: 8px; }

/* ---- Article sheet (posts, notes, static pages) ---- */
.note-page-section {
    background: var(--panel); border: var(--edge); border-radius: 12px; box-shadow: var(--drop);
    padding: clamp(1.4rem, 4vw, 2.8rem);
}
.note-page-section h1 { font-size: clamp(1.85rem, calc(1.25rem + 2vw), 2.7rem); font-weight: 500; line-height: 1.14; letter-spacing: -0.02em; }
.note-page-section .content { font-family: var(--primary-font-family); font-size: 1.06rem; line-height: 1.76; color: var(--ink); }
.note-page-section .content p, .note-page-section .content li { margin-bottom: 1.05rem; }
.note-page-section .content h2, .note-page-section .content h3, .note-page-section .content h4 { font-weight: 500; line-height: 1.25; margin-top: 2.3rem; margin-bottom: 0.7rem; color: var(--ink); }
.note-page-section .content h2 { font-size: 1.55rem; }
.note-page-section .content h3 { font-size: 1.22rem; }
.note-page-section .content strong { color: var(--ink); }
.note-page-section .content a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.note-page-section .content a:hover { color: var(--ink); text-decoration-color: var(--accent); }
.note-page-section .content blockquote { border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; margin: 1.6rem 0; padding: 0.85rem 1.25rem; color: var(--sub); }
.note-page-section .content hr { border: 0; border-top: 1px solid var(--border-col); background: none; height: 0; margin: 2.4rem 0; }
.note-page-section .content img, .note-page-section .content iframe { border: var(--edge); border-radius: 8px; max-width: 100%; }
.note-page-section .content code { font-family: var(--mono-font-family); font-size: 0.82em; background: var(--surface); color: var(--ink); padding: 0.14em 0.42em; border-radius: 4px; }
.note-page-section .content pre { border: var(--edge); border-radius: 8px; padding: 1rem 1.1rem; overflow-x: auto; font-size: 0.84rem; background: #1a1917; color: #f5f3ec; }
.note-page-section .content pre code { background: none; padding: 0; color: inherit; }
.post-meta { font-family: var(--mono-font-family); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--sub); margin: 0 0 1rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.tag, a.tag, .content .tag {
    font-family: var(--mono-font-family) !important; font-size: 0.62rem !important; letter-spacing: 0.05em; text-transform: uppercase;
    background: transparent !important; color: var(--ink) !important; border: 1px solid var(--border-col); border-radius: 4px; height: auto; padding: 0.24em 0.55em;
}
.tooltip .right { background: var(--panel); color: var(--ink); border: var(--edge); }
.about-facts { list-style: none; padding: 0; margin: 1.4rem 0 !important; }
.about-facts li { display: flex; gap: 0.8rem; padding: 0.6rem 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); font-size: 0.95rem; margin: 0 !important; }
.about-facts li span:first-child { font-family: var(--mono-font-family); color: var(--sub); min-width: 9rem; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 0.25rem; }

/* ---- Footer ---- */
.site-footer {
    max-width: 74rem; margin: 0 auto; padding: 1.6rem 1.5rem 5.5rem; border-top: 1px solid var(--border-col);
    display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: center; justify-content: space-between;
    font-family: var(--mono-font-family); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--sub);
}
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer__links { display: flex; gap: 1.1rem; flex-wrap: wrap; }

/* ---- Reading list ---- */
.reading-group { margin-top: 2.2rem; }
.reading-group:first-of-type { margin-top: 0.4rem; }
.reading-group__count { font-family: var(--mono-font-family); font-size: 0.72rem; color: var(--sub); }
.reading-list { list-style: none; margin: 0; padding: 0; }
.reading-item { padding: 0.95rem 0; border-bottom: var(--edge); }
.reading-item:last-child { border-bottom: 0; }
.reading-item__top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.reading-item__heading { display: inline-flex; align-items: baseline; gap: 0.45rem; flex-wrap: wrap; }
.reading-item__title { font-family: var(--secondary-font-family); font-size: 1.24rem; color: var(--ink); line-height: 1.3; text-decoration: none; transition: color 0.14s ease; }
a.reading-item__title:hover { color: var(--accent); text-decoration: none; }
.reading-item__ext { font-family: var(--mono-font-family); font-size: 0.78rem; color: var(--sub); transition: color 0.14s ease; }
a.reading-item__title:hover .reading-item__ext { color: var(--accent); }
.reading-item__fav { font-size: 0.85rem; color: var(--hot); line-height: 1; }
.reading-item__meta { display: inline-flex; align-items: center; gap: 0.55rem; flex-shrink: 0; }
.reading-item__year { font-family: var(--mono-font-family); font-size: 0.74rem; color: var(--sub); white-space: nowrap; }
.reading-item__author { font-family: var(--primary-font-family); font-size: 0.86rem; color: var(--sub); margin-top: 0.15rem; }
.reading-item__note { font-family: var(--primary-font-family); font-size: 0.92rem; line-height: 1.55; color: var(--sub); margin: 0.4rem 0 0; }
.reading-empty { font-family: var(--secondary-font-family); font-style: italic; color: var(--sub); margin-top: 1.2rem; }

/* ---- Command palette ---- */
.palette { width: min(38rem, calc(100vw - 2rem)); max-height: 76vh; margin: 12vh auto 0; padding: 0; color: var(--ink); background: var(--panel); border: 1px solid var(--border-col); border-radius: 12px; box-shadow: 0 24px 48px -16px rgba(20, 20, 19, 0.24); overflow: hidden; }
.palette[open] { display: flex; flex-direction: column; animation: drop-in 0.2s cubic-bezier(.16, 1, .3, 1); }
.palette::backdrop { background: color-mix(in srgb, var(--bg) 74%, transparent); backdrop-filter: blur(5px); }
@keyframes drop-in { from { opacity: 0; transform: translateY(-12px) scale(0.98); } }
.palette__in { width: 100%; font: 500 1.05rem var(--primary-font-family); color: var(--ink); background: none; border: 0; border-bottom: var(--edge); padding: 1rem 1.15rem; outline: none; }
.palette__in::placeholder { color: var(--sub); }
.palette__list { overflow-y: auto; padding: 0.4rem; margin: 0; list-style: none; }
.palette__item { display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left; padding: 0.6rem 0.75rem; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 500 0.94rem var(--primary-font-family); text-decoration: none; cursor: pointer; }
.palette__item.active { background: var(--hi); color: var(--on-hi); }
.palette__kind { flex: none; width: 4.8rem; font-family: var(--mono-font-family); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.palette__foot { border-top: var(--edge); padding: 0.55rem 1.1rem; display: flex; gap: 1.2rem; }
.palette__empty { padding: 1rem; color: var(--sub); }

/* theme switch wipe */
html.shifting::view-transition-old(root) { animation: none; }
html.shifting::view-transition-new(root) { animation: shift-wipe 0.55s ease-out; }
@keyframes shift-wipe { from { clip-path: circle(0 at var(--vx, 50%) var(--vy, 0)); } to { clip-path: circle(150vmax at var(--vx, 50%) var(--vy, 0)); } }

/* ---- No script fallbacks ---- */
html:not(.js) [data-open-palette], html:not(.js) [data-shift-toggle], html:not(.js) [data-sfx-toggle] { display: none; }

/* ---- Responsive ---- */
@media (min-width: 700px) and (max-width: 980px) {
    .topbar { flex-wrap: wrap; }
    .topbar__nav { order: 3; width: 100%; }
}
@media (max-width: 699px) {
    .section { padding: 1.2rem 1rem 3rem; }
    .topbar { padding: 0.65rem 1rem; flex-wrap: wrap; }
    .topbar__nav { order: 3; width: 100%; overflow-x: auto; }
    .tool--icon, .tool kbd { display: none; }
    .about-facts li { flex-direction: column; gap: 0.1rem; }
    .writing-item { flex-direction: column; gap: 0.2rem; }
    .reading-item__top { flex-direction: column; gap: 0.35rem; }
    .mascot { width: 54px; height: 54px; right: 0.75rem; bottom: 0.75rem; }
    .mascot__say { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html, html[data-theme] { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}
