← All writing
· 3 min read

Spoken Code Backup

Backup of Base.astro

---
import '../styles/global.css';
import { SITE } from '../config';

interface Props { title?: string; description?: string; }
const { title, description = SITE.description } = Astro.props;
const fullTitle = title ? `${title} — ${SITE.title}` : `${SITE.title} — ${SITE.tagline}`;
const canonical = Astro.site ? new URL(Astro.url.pathname, Astro.site).href : undefined;
const path = Astro.url.pathname;
const year = new Date().getFullYear();
---
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="color-scheme" content="light dark" />
    <title>{fullTitle}</title>
    <meta name="description" content={description} />
    {canonical && <link rel="canonical" href={canonical} />}
    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
    <link rel="alternate" type="application/rss+xml" title={SITE.title} href="/rss.xml" />
    <meta property="og:title" content={fullTitle} />
    <meta property="og:description" content={description} />
    <meta property="og:type" content="website" />
  </head>
  <body>
    <header class="site-header">
      <div class="wrap">
        <a class="brand" href="/">{SITE.title}</a>
        <nav class="nav" aria-label="Main">
          {SITE.nav.map((item) => (
            <a href={item.href} aria-current={path === item.href ? 'page' : undefined}>{item.label}</a>
          ))}
        </nav>
      </div>
    </header>
    <main class="wrap">
      <slot />
    </main>
    <footer class="site-footer">
      <div class="wrap">
        <span>© {year} {SITE.author}</span>
        <span>Built with Astro. Static, no CMS.</span>
      </div>
    </footer>
  </body>
</html>

Backup of Bsrc/styles/global.css

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --line: #e8e8e6;
  --accent: #111111;
  --measure: 40rem;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Charter, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0e0d; --fg: #f2f2ef; --muted: #9a9a95; --line: #262624; --accent: #f2f2ef; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 2px; }

/* header */
.site-header { padding: 2rem 0 0; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.brand { font-weight: 600; letter-spacing: -0.01em; text-decoration: none; }
.nav { display: flex; gap: 1.25rem; font-size: 0.95rem; color: var(--muted); }
.nav a { text-decoration: none; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--fg); }

/* hero */
.hero { padding: clamp(4rem, 14vw, 9rem) 0 clamp(2.5rem, 8vw, 5rem); }
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.75rem, 9vw, 5.25rem); line-height: 1.02; letter-spacing: -0.03em;
  margin: 0 0 1.25rem; text-wrap: balance;
}
.hero p { margin: 0; font-size: 1.25rem; color: var(--muted); max-width: 30rem; }

/* post list */
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list a { display: block; padding: 1.75rem 0; text-decoration: none; }
.post-list time { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
.post-list h2 {
  font-family: var(--serif); font-weight: 500; font-size: 1.75rem; line-height: 1.2;
  letter-spacing: -0.015em; margin: 0 0 0.4rem;
}
.post-list p { margin: 0; color: var(--muted); }
.post-list a:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }

/* article */
.article-head { padding: clamp(3rem, 10vw, 6rem) 0 2rem; }
.article-head .meta { font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem; }
.article-head h1 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(2.25rem, 7vw, 3.75rem);
  line-height: 1.05; letter-spacing: -0.025em; margin: 0; text-wrap: balance;
}
.prose { padding-bottom: 3rem; }
.prose > * + * { margin-top: 1.4em; }
.prose h2, .prose h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; margin-top: 2.2em; }
.prose h2 { font-size: 1.7rem; }
.prose h3 { font-size: 1.3rem; }
.prose blockquote { margin-left: 0; padding-left: 1.25rem; border-left: 2px solid var(--fg); font-family: var(--serif); font-size: 1.25rem; line-height: 1.5; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--line); padding: 0.15em 0.4em; border-radius: 4px; }
.prose pre { overflow-x: auto; padding: 1rem 1.25rem; background: var(--line); border-radius: 8px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.back { display: inline-block; margin: 1rem 0 3rem; color: var(--muted); font-size: 0.95rem; text-decoration: none; }
.back:hover { color: var(--fg); }

/* footer */
.site-footer { margin-top: 5rem; padding: 2rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Add this at the bottom for a fade between pages, with the header kept steady. Chrome, Edge and Safari 18.2+ support it, and Firefox ignores it. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}