681 lines
18 KiB
CSS
681 lines
18 KiB
CSS
@import "tailwindcss";
|
|
|
|
/* Dark mode: class-based (for @wrksz/themes) */
|
|
@custom-variant dark (&:is(.dark));
|
|
|
|
:root {
|
|
--scroll-offset: 7.5rem; /* ~120px, generous offset for sticky header */
|
|
}
|
|
|
|
/* === Design Tokens === */
|
|
@theme {
|
|
/* Colors — Light mode defaults */
|
|
--color-canvas: oklch(1 0 0);
|
|
--color-surface: oklch(0.98 0 0);
|
|
--color-ink: oklch(0.08 0 0);
|
|
--color-ink-soft: oklch(0.40 0 0);
|
|
--color-border: oklch(0.92 0 0);
|
|
--color-accent: oklch(0.45 0.18 250);
|
|
|
|
/* Code blocks — Light mode */
|
|
--color-code-block: oklch(0.97 0 0);
|
|
--color-code-block-hover: oklch(0.95 0 0);
|
|
--color-code-gutter: oklch(0.50 0 0);
|
|
--color-code-gutter-border: oklch(0.90 0 0);
|
|
--color-code-title-bg: oklch(0.95 0 0);
|
|
--color-code-title-text: oklch(0.40 0 0);
|
|
--color-code-line-highlight: oklch(0.92 0.02 250 / 0.3);
|
|
--color-code-line-highlight-border: oklch(0.45 0.20 250);
|
|
--color-code-mark-bg: oklch(0.90 0.03 250 / 0.4);
|
|
--color-code-copy: oklch(0.40 0 0);
|
|
--color-code-copy-hover: oklch(0.25 0 0);
|
|
--color-code-dot-red: oklch(0.60 0.22 15);
|
|
--color-code-dot-yellow: oklch(0.75 0.18 65);
|
|
--color-code-dot-green: oklch(0.65 0.18 140);
|
|
--radius-code: 0.75rem;
|
|
|
|
/* Fonts — override defaults */
|
|
--font-sans: "Fraunces", ui-sans-serif, system-ui, sans-serif;
|
|
--font-serif: "IBM Plex Mono", ui-monospace, monospace;
|
|
--font-mono: "JetBrains Mono", ui-monospace, monospace;
|
|
|
|
/* Typography scale */
|
|
--text-xs: 0.75rem; --text-xs--line-height: 1.2;
|
|
--text-sm: 0.875rem; --text-sm--line-height: 1.4;
|
|
--text-base: 1rem; --text-base--line-height: 1.5;
|
|
--text-lg: 1.125rem; --text-lg--line-height: 1.6;
|
|
--text-xl: 1.25rem; --text-xl--line-height: 1.6;
|
|
--text-2xl: 1.5rem; --text-2xl--line-height: 2rem;
|
|
--text-3xl: 1.875rem; --text-3xl--line-height: 2.25rem;
|
|
--text-4xl: 2.25rem; --text-4xl--line-height: 2.5rem;
|
|
--text-5xl: 3rem; --text-5xl--line-height: 1.1;
|
|
|
|
/* Shadows */
|
|
--shadow-card: 0 1px 3px oklch(0 0 0 / 0.08);
|
|
--shadow-card-hover: 0 20px 45px -32px oklch(0 0 0 / 0.35), 0 1px 3px oklch(0 0 0 / 0.08);
|
|
|
|
/* Animations */
|
|
--animate-fade-in: fade-in 0.3s ease-out;
|
|
--animate-fade-in-up: fade-in-up 0.4s ease-out;
|
|
--animate-slide-up: slide-up 0.5s ease-out;
|
|
|
|
@keyframes fade-in {
|
|
from { opacity: 0; }
|
|
to { opacity: 1; }
|
|
}
|
|
@keyframes fade-in-up {
|
|
from { opacity: 0; transform: translateY(12px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
@keyframes slide-up {
|
|
from { opacity: 0; transform: translateY(24px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
}
|
|
|
|
@layer base {
|
|
html {
|
|
scroll-padding-top: var(--scroll-offset);
|
|
}
|
|
body {
|
|
font-family: var(--font-serif);
|
|
font-weight: 400;
|
|
line-height: 1.6;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
}
|
|
h1, h2, h3, h4, h5, h6 {
|
|
font-family: var(--font-sans);
|
|
font-weight: 700;
|
|
line-height: 1.25;
|
|
letter-spacing: -0.015em;
|
|
}
|
|
h1 { line-height: 1.15; letter-spacing: -0.025em; }
|
|
h2 { line-height: 1.2; letter-spacing: -0.02em; }
|
|
code, pre, kbd, samp {
|
|
font-family: var(--font-mono);
|
|
font-feature-settings: 'liga' 1, 'calt' 1;
|
|
}
|
|
a {
|
|
text-underline-offset: 3px;
|
|
text-decoration-thickness: 1px;
|
|
transition: text-decoration-thickness 0.15s ease;
|
|
}
|
|
a:hover {
|
|
text-decoration-thickness: 3px;
|
|
}
|
|
:where(a, button, input, textarea, select, [role="button"]):focus-visible {
|
|
outline: 2px solid var(--color-accent);
|
|
outline-offset: 3px;
|
|
border-radius: 0.375rem;
|
|
}
|
|
}
|
|
|
|
/* === Dark mode token overrides === */
|
|
.dark {
|
|
--color-canvas: oklch(0 0 0);
|
|
--color-surface: oklch(0.07 0 0);
|
|
--color-ink: oklch(1 0 0);
|
|
--color-ink-soft: oklch(0.72 0 0);
|
|
--color-border: oklch(0.17 0 0);
|
|
--color-accent: oklch(0.68 0.20 250);
|
|
|
|
/* Code blocks — Dark mode */
|
|
--color-code-block: oklch(0.04 0 0);
|
|
--color-code-block-hover: oklch(0.06 0 0);
|
|
--color-code-gutter: oklch(0.30 0 0);
|
|
--color-code-gutter-border: oklch(0.14 0 0);
|
|
--color-code-title-bg: oklch(0.03 0 0);
|
|
--color-code-title-text: oklch(0.55 0 0);
|
|
--color-code-line-highlight: oklch(0.12 0.02 250 / 0.3);
|
|
--color-code-line-highlight-border: oklch(0.68 0.20 250);
|
|
--color-code-mark-bg: oklch(0.10 0.03 250 / 0.4);
|
|
--color-code-copy: oklch(0.60 0 0);
|
|
--color-code-copy-hover: oklch(0.85 0 0);
|
|
|
|
--shadow-card: 0 1px 4px oklch(1 0 0 / 0.06);
|
|
--shadow-card-hover: 0 22px 50px -34px oklch(1 0 0 / 0.22), 0 1px 4px oklch(1 0 0 / 0.08);
|
|
}
|
|
|
|
/* === Editorial list surfaces === */
|
|
.editorial-hero {
|
|
position: relative;
|
|
overflow: hidden;
|
|
isolation: isolate;
|
|
background:
|
|
radial-gradient(circle at 20% 10%, color-mix(in oklch, var(--color-accent) 10%, transparent), transparent 34%),
|
|
linear-gradient(135deg, color-mix(in oklch, var(--color-surface) 88%, var(--color-canvas)), var(--color-canvas));
|
|
}
|
|
|
|
.editorial-hero::after {
|
|
content: "";
|
|
position: absolute;
|
|
inset: 0;
|
|
pointer-events: none;
|
|
z-index: 0;
|
|
opacity: 0.35;
|
|
background-image: radial-gradient(color-mix(in oklch, var(--color-ink) 18%, transparent) 0.5px, transparent 0.5px);
|
|
background-size: 12px 12px;
|
|
mask-image: linear-gradient(135deg, black, transparent 78%);
|
|
}
|
|
|
|
.dark .editorial-hero {
|
|
background:
|
|
radial-gradient(circle at 20% 10%, color-mix(in oklch, var(--color-accent) 14%, transparent), transparent 36%),
|
|
linear-gradient(135deg, color-mix(in oklch, var(--color-surface) 82%, var(--color-canvas)), var(--color-canvas));
|
|
}
|
|
|
|
.dark .editorial-hero::after {
|
|
opacity: 0.22;
|
|
}
|
|
|
|
.empty-state {
|
|
display: grid;
|
|
gap: 0.75rem;
|
|
border: 1px dashed color-mix(in oklch, var(--color-border) 78%, var(--color-ink) 22%);
|
|
border-radius: 1.25rem;
|
|
background: color-mix(in oklch, var(--color-surface) 55%, transparent);
|
|
padding: 2rem;
|
|
}
|
|
|
|
/* === Local prose styles (Tailwind Typography plugin is not installed) === */
|
|
.prose {
|
|
color: var(--color-ink);
|
|
font-size: 1rem;
|
|
line-height: 1.75;
|
|
overflow-wrap: break-word;
|
|
}
|
|
|
|
.prose :where(h1, h2, h3, h4, h5, h6) {
|
|
color: var(--color-ink);
|
|
scroll-margin-top: var(--scroll-offset);
|
|
}
|
|
|
|
.prose :where(h1) { margin: 2.75rem 0 1rem; }
|
|
.prose :where(h2) { margin: 3rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--color-border); }
|
|
.prose :where(h3) { margin: 2.25rem 0 0.75rem; }
|
|
.prose :where(h4, h5, h6) { margin: 1.75rem 0 0.5rem; }
|
|
.prose :where(h1, h2, h3, h4, h5, h6):first-child { margin-top: 0; }
|
|
|
|
.prose :where(p) {
|
|
margin: 1.25rem 0;
|
|
color: var(--color-ink);
|
|
}
|
|
|
|
.article-prose :where(p, ul, ol, blockquote, details, .callout, [data-callout]) {
|
|
max-width: 72ch;
|
|
}
|
|
|
|
.prose :where(a) {
|
|
color: var(--color-accent);
|
|
text-decoration-thickness: 1px;
|
|
}
|
|
|
|
.prose :where(ul, ol) {
|
|
margin: 1.5rem 0;
|
|
padding-left: 1.5rem;
|
|
}
|
|
|
|
.prose :where(li) { margin: 0.45rem 0; padding-left: 0.2rem; }
|
|
.prose :where(li)::marker { color: var(--color-accent); }
|
|
.prose :where(li > p) { margin: 0.5rem 0; }
|
|
|
|
.prose :where(blockquote) {
|
|
margin: 2rem 0;
|
|
border-left: 4px solid color-mix(in oklch, var(--color-accent) 45%, var(--color-border));
|
|
border-radius: 0 1rem 1rem 0;
|
|
background: color-mix(in oklch, var(--color-surface) 70%, transparent);
|
|
padding: 0.75rem 1rem 0.75rem 1.25rem;
|
|
color: var(--color-ink-soft);
|
|
}
|
|
|
|
.prose :where(blockquote p) { margin: 0.5rem 0; }
|
|
|
|
.prose :where(.callout, [data-callout]) {
|
|
margin: 2rem 0;
|
|
border: 1px solid color-mix(in oklch, var(--color-accent) 28%, var(--color-border));
|
|
border-radius: 1rem;
|
|
background: color-mix(in oklch, var(--color-accent) 8%, var(--color-surface));
|
|
padding: 1rem;
|
|
}
|
|
|
|
.prose :where(details) {
|
|
margin: 2rem 0;
|
|
border: 1px solid var(--color-border);
|
|
border-radius: 1rem;
|
|
background: color-mix(in oklch, var(--color-surface) 82%, var(--color-canvas));
|
|
padding: 1rem 1.125rem;
|
|
}
|
|
|
|
.prose :where(summary) {
|
|
cursor: pointer;
|
|
color: var(--color-ink);
|
|
font-weight: 700;
|
|
}
|
|
|
|
.prose :where(details[open] summary) { margin-bottom: 0.75rem; }
|
|
.prose :where(details > :last-child) { margin-bottom: 0; }
|
|
|
|
.prose :where(figure) { margin: 2.5rem 0; }
|
|
|
|
.prose :where(img) {
|
|
display: block;
|
|
max-width: min(100%, 56rem);
|
|
height: auto;
|
|
margin: 2rem auto;
|
|
border: 1px solid var(--color-border);
|
|
border-radius: 1rem;
|
|
background: var(--color-surface);
|
|
box-shadow: var(--shadow-card);
|
|
}
|
|
|
|
.prose :where(p:has(> img:only-child)) {
|
|
margin: 2.5rem 0 1rem;
|
|
}
|
|
|
|
.article-prose :where(p:has(> img:only-child)) {
|
|
max-width: none;
|
|
}
|
|
|
|
.prose :where(p:has(> img:only-child) + em),
|
|
.prose :where(p:has(> img:only-child) + strong) {
|
|
display: block;
|
|
margin-top: -0.5rem;
|
|
text-align: center;
|
|
color: var(--color-ink-soft);
|
|
font-size: 0.875rem;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.prose :where(figcaption) {
|
|
margin-top: 0.75rem;
|
|
color: var(--color-ink-soft);
|
|
font-size: 0.875rem;
|
|
line-height: 1.5;
|
|
text-align: center;
|
|
}
|
|
|
|
.prose :where(table) {
|
|
width: 100%;
|
|
min-width: 40rem;
|
|
border-collapse: collapse;
|
|
color: var(--color-ink);
|
|
}
|
|
|
|
.prose :where(th, td) {
|
|
border: 1px solid var(--color-border);
|
|
padding: 0.75rem 0.875rem;
|
|
text-align: left;
|
|
vertical-align: top;
|
|
}
|
|
|
|
.prose :where(th) {
|
|
background: var(--color-surface);
|
|
color: var(--color-ink);
|
|
font-weight: 700;
|
|
}
|
|
|
|
.prose :where(tbody tr:nth-child(even)) {
|
|
background: color-mix(in oklch, var(--color-surface) 55%, transparent);
|
|
}
|
|
|
|
.prose :where(pre) {
|
|
max-width: 100%;
|
|
overflow-x: auto;
|
|
}
|
|
|
|
.prose :where(:not(pre) > code) {
|
|
color: var(--color-ink);
|
|
}
|
|
|
|
/* === Code Blocks: Borderless, VS Code Style, Line Numbers === */
|
|
[data-rehype-pretty-code-figure] {
|
|
@apply relative overflow-hidden rounded-[var(--radius-code)];
|
|
background-color: var(--color-code-block);
|
|
border: none;
|
|
box-shadow: 0 0 0 1px var(--color-border),
|
|
0 2px 8px oklch(0 0 0 / 0.06);
|
|
}
|
|
.dark [data-rehype-pretty-code-figure] {
|
|
box-shadow: 0 0 0 1px var(--color-border),
|
|
0 2px 8px oklch(1 0 0 / 0.04);
|
|
}
|
|
|
|
[data-rehype-pretty-code-title] {
|
|
@apply relative flex items-center gap-2.5 px-4 py-2 text-xs;
|
|
background-color: var(--color-code-title-bg);
|
|
border-bottom: 1px solid var(--color-border);
|
|
border-radius: var(--radius-code) var(--radius-code) 0 0;
|
|
}
|
|
.dark [data-rehype-pretty-code-title] {
|
|
background-color: var(--color-code-title-bg);
|
|
}
|
|
|
|
[data-rehype-pretty-code-title] + pre {
|
|
@apply m-0 rounded-b-[var(--radius-code)] rounded-t-none;
|
|
}
|
|
|
|
[data-rehype-pretty-code-title] .vscode-dots {
|
|
@apply inline-flex gap-[6px] mr-2;
|
|
}
|
|
[data-rehype-pretty-code-title] .vscode-dots span {
|
|
@apply block h-2.5 w-2.5 rounded-full;
|
|
}
|
|
[data-rehype-pretty-code-title] .dot-red {
|
|
background-color: var(--color-code-dot-red);
|
|
box-shadow: inset 0 0 0 0.5px oklch(0 0 0 / 0.15);
|
|
}
|
|
[data-rehype-pretty-code-title] .dot-yellow {
|
|
background-color: var(--color-code-dot-yellow);
|
|
box-shadow: inset 0 0 0 0.5px oklch(0 0 0 / 0.15);
|
|
}
|
|
[data-rehype-pretty-code-title] .dot-green {
|
|
background-color: var(--color-code-dot-green);
|
|
box-shadow: inset 0 0 0 0.5px oklch(0 0 0 / 0.15);
|
|
}
|
|
|
|
[data-rehype-pretty-code-figure] pre {
|
|
@apply relative overflow-auto p-4;
|
|
}
|
|
|
|
[data-rehype-pretty-code-figure] pre code {
|
|
@apply !bg-transparent font-mono text-[13px] leading-[1.6];
|
|
display: grid;
|
|
}
|
|
|
|
[data-rehype-pretty-code-figure] code[data-line-numbers] {
|
|
counter-reset: line;
|
|
}
|
|
[data-rehype-pretty-code-figure] code[data-line-numbers] > [data-line]::before {
|
|
counter-increment: line;
|
|
content: counter(line);
|
|
@apply mr-5 inline-block w-4 text-right select-none;
|
|
color: oklch(0.30 0 0);
|
|
@apply text-[11px] font-mono;
|
|
}
|
|
.dark [data-rehype-pretty-code-figure] code[data-line-numbers] > [data-line]::before {
|
|
color: oklch(0.60 0 0);
|
|
}
|
|
|
|
[data-rehype-pretty-code-figure] [data-line] {
|
|
@apply relative px-2;
|
|
border-left: 2px solid transparent;
|
|
}
|
|
|
|
[data-rehype-pretty-code-figure] [data-highlighted-line] {
|
|
@apply rounded-r-sm;
|
|
background-color: var(--color-code-line-highlight);
|
|
border-left-color: var(--color-code-line-highlight-border);
|
|
}
|
|
|
|
[data-rehype-pretty-code-figure] [data-highlighted-chars] {
|
|
@apply rounded py-0.5 px-1;
|
|
background-color: var(--color-code-mark-bg);
|
|
}
|
|
|
|
[data-rehype-pretty-code-figure] .rehype-pretty-copy {
|
|
@apply absolute right-3 top-3 z-10 flex items-center gap-1 rounded-md border px-2 py-1 text-xs font-medium;
|
|
background-color: oklch(0.97 0 0 / 0.85);
|
|
color: var(--color-code-copy);
|
|
opacity: 0;
|
|
transition: opacity 0.15s ease;
|
|
}
|
|
.dark [data-rehype-pretty-code-figure] .rehype-pretty-copy {
|
|
background-color: oklch(0.10 0 0 / 0.85);
|
|
color: var(--color-code-copy);
|
|
}
|
|
[data-rehype-pretty-code-figure]:hover .rehype-pretty-copy,
|
|
[data-rehype-pretty-code-figure] .rehype-pretty-copy:focus-visible,
|
|
[data-rehype-pretty-code-figure] .rehype-pretty-copy:focus {
|
|
opacity: 1;
|
|
}
|
|
[data-rehype-pretty-code-figure] .rehype-pretty-copy:hover,
|
|
[data-rehype-pretty-code-figure] .rehype-pretty-copy:focus-visible {
|
|
@apply border-current;
|
|
background-color: oklch(0.95 0 0 / 0.95);
|
|
color: var(--color-code-copy-hover);
|
|
}
|
|
.dark [data-rehype-pretty-code-figure] .rehype-pretty-copy:hover,
|
|
.dark [data-rehype-pretty-code-figure] .rehype-pretty-copy:focus-visible {
|
|
background-color: oklch(0.15 0 0 / 0.95);
|
|
}
|
|
[data-rehype-pretty-code-figure] .rehype-pretty-copy.rehype-pretty-copied {
|
|
@apply border-green-500/50;
|
|
color: oklch(0.55 0.18 140);
|
|
}
|
|
.dark [data-rehype-pretty-code-figure] .rehype-pretty-copy.rehype-pretty-copied {
|
|
color: oklch(0.70 0.15 140);
|
|
}
|
|
|
|
/* Shiki dual theme token color switching */
|
|
code[data-theme*=" "],
|
|
code[data-theme*=" "] span {
|
|
color: var(--shiki-light);
|
|
}
|
|
html.dark code[data-theme*=" "],
|
|
html.dark code[data-theme*=" "] span {
|
|
color: var(--shiki-dark);
|
|
}
|
|
|
|
/* === KaTeX dark mode overrides === */
|
|
.dark .katex,
|
|
.dark .katex * {
|
|
color: currentColor !important;
|
|
}
|
|
.prose .katex-display {
|
|
color: currentColor !important;
|
|
}
|
|
.prose .katex-display .katex .base {
|
|
color: currentColor !important;
|
|
}
|
|
.katex .mfrac .frac-line,
|
|
.katex .sqrt .sqrt-line,
|
|
.katex .overline .overline-line,
|
|
.katex .underline .underline-line {
|
|
border-color: currentColor !important;
|
|
}
|
|
.katex {
|
|
font-size: 1.1em !important;
|
|
}
|
|
.katex-display {
|
|
overflow-x: auto;
|
|
overflow-y: hidden;
|
|
max-width: 100%;
|
|
margin: 1.75em 0;
|
|
padding: 0.25rem 0 0.6rem;
|
|
text-align: center;
|
|
-webkit-overflow-scrolling: touch;
|
|
}
|
|
.katex-display > .katex {
|
|
display: inline-block;
|
|
min-width: max-content;
|
|
text-align: center;
|
|
white-space: nowrap;
|
|
}
|
|
@media (max-width: 640px) {
|
|
.katex-display {
|
|
margin: 1.25em 0;
|
|
text-align: left;
|
|
}
|
|
}
|
|
.prose p + .katex-display { margin-top: 0.5em; }
|
|
.prose .katex-display + p { margin-bottom: 0.5em; }
|
|
.prose p .katex { vertical-align: middle; }
|
|
.katex .katex-mathml {
|
|
position: absolute;
|
|
clip: rect(1px, 1px, 1px, 1px);
|
|
padding: 0;
|
|
border: 0;
|
|
}
|
|
|
|
/* === Heading utilities === */
|
|
@utility heading-xl {
|
|
font-size: 2.25rem;
|
|
font-weight: 800;
|
|
letter-spacing: -0.025em;
|
|
line-height: 1.1;
|
|
}
|
|
|
|
@utility heading-lg {
|
|
font-size: 1.875rem;
|
|
font-weight: 600;
|
|
letter-spacing: -0.025em;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
@utility heading-md {
|
|
font-size: 1.5rem;
|
|
font-weight: 600;
|
|
letter-spacing: -0.025em;
|
|
line-height: 1.3;
|
|
}
|
|
|
|
@utility heading-sm {
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
letter-spacing: -0.01em;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
/* === Scroll progress bar (CSS animation-timeline + JS fallback) === */
|
|
.scroll-progress {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
height: 2px;
|
|
width: 0%;
|
|
background: var(--color-ink);
|
|
z-index: 9999;
|
|
will-change: width;
|
|
}
|
|
|
|
@keyframes scroll-progress { from { width: 0%; } to { width: 100%; } }
|
|
@supports (animation-timeline: scroll()) {
|
|
.scroll-progress {
|
|
width: 0%;
|
|
animation: scroll-progress linear forwards;
|
|
animation-timeline: scroll(root block);
|
|
}
|
|
}
|
|
|
|
/* === Scroll-to-top button === */
|
|
.scroll-to-top {
|
|
position: fixed;
|
|
bottom: 24px;
|
|
right: 24px;
|
|
width: 40px;
|
|
height: 40px;
|
|
border: 1px solid var(--color-border);
|
|
border-radius: 50%;
|
|
background: var(--color-canvas);
|
|
color: var(--color-ink);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
opacity: 0;
|
|
transform: translateY(10px);
|
|
pointer-events: none;
|
|
transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.2s ease;
|
|
z-index: 9997;
|
|
will-change: opacity, transform;
|
|
}
|
|
.scroll-to-top.visible {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
pointer-events: auto;
|
|
}
|
|
.scroll-to-top:hover {
|
|
border-color: var(--color-ink);
|
|
}
|
|
|
|
/* === Reading progress vertical bar === */
|
|
.reading-progress {
|
|
position: fixed; right: 12px; top: 50%; transform: translateY(-50%);
|
|
width: 3px; height: 60px;
|
|
background: color-mix(in oklch, var(--color-ink) 8%, transparent);
|
|
border-radius: 2px; z-index: 9998; overflow: hidden;
|
|
}
|
|
.dark .reading-progress {
|
|
background: color-mix(in oklch, var(--color-ink) 15%, transparent);
|
|
}
|
|
.reading-progress-fill {
|
|
width: 100%;
|
|
height: 0%;
|
|
background: var(--color-ink);
|
|
border-radius: 2px;
|
|
}
|
|
@keyframes reading-progress { from { height: 0%; } to { height: 100%; } }
|
|
@supports (animation-timeline: scroll()) {
|
|
.reading-progress-fill {
|
|
animation: reading-progress linear forwards;
|
|
animation-timeline: scroll(root block);
|
|
}
|
|
}
|
|
|
|
/* === Global transition for theme switch === */
|
|
body, body *, [class*="bg-"], [class*="border-"], [class*="text-"] {
|
|
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
|
|
}
|
|
|
|
/* === Reduced motion === */
|
|
@media (prefers-reduced-motion: reduce) {
|
|
*, *::before, *::after {
|
|
animation-duration: 0.01ms !important;
|
|
animation-iteration-count: 1 !important;
|
|
transition-duration: 0.01ms !important;
|
|
scroll-behavior: auto !important;
|
|
}
|
|
.scroll-progress { display: none; }
|
|
.scroll-to-top { opacity: 0 !important; pointer-events: none !important; }
|
|
.reading-progress { display: none !important; }
|
|
}
|
|
|
|
/* === Focus visible for scroll-to-top === */
|
|
.scroll-to-top:focus-visible {
|
|
outline: 2px solid var(--color-accent);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
/* Callout/Admonition styles */
|
|
.callout {
|
|
@apply my-6 rounded-lg border p-4 text-sm leading-relaxed;
|
|
}
|
|
.callout-title {
|
|
@apply flex items-center gap-2 font-semibold mb-2;
|
|
}
|
|
.callout-icon {
|
|
@apply text-base;
|
|
}
|
|
.callout-content {
|
|
@apply pl-6;
|
|
}
|
|
|
|
/* Type variants */
|
|
.callout-note {
|
|
@apply border-accent/30 bg-accent/[0.06];
|
|
}
|
|
.callout-note .callout-title {
|
|
@apply text-accent;
|
|
}
|
|
|
|
.callout-tip {
|
|
@apply border-emerald-500/30 bg-emerald-500/[0.06];
|
|
}
|
|
.callout-tip .callout-title {
|
|
@apply text-emerald-600 dark:text-emerald-400;
|
|
}
|
|
|
|
.callout-warning {
|
|
@apply border-amber-500/30 bg-amber-500/[0.06];
|
|
}
|
|
.callout-warning .callout-title {
|
|
@apply text-amber-600 dark:text-amber-400;
|
|
}
|
|
|
|
.callout-danger {
|
|
@apply border-red-500/30 bg-red-500/[0.06];
|
|
}
|
|
.callout-danger .callout-title {
|
|
@apply text-red-600 dark:text-red-400;
|
|
}
|