:root {
  color-scheme: light dark;
  --bg: oklch(0.985 0.002 160);
  --surface: oklch(0.95 0.006 160);
  --ink: oklch(0.23 0.014 160);
  --muted: oklch(0.44 0.018 160);
  --accent: oklch(0.40 0.09 160);
  --on-accent: oklch(0.99 0 0);
  --border: oklch(0.60 0.018 160);
  --error: oklch(0.43 0.16 25);
  --error-bg: oklch(0.96 0.02 25);
  --focus: oklch(0.40 0.09 160);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.16 0.005 160);
    --surface: oklch(0.21 0.008 160);
    --ink: oklch(0.94 0.008 160);
    --muted: oklch(0.76 0.014 160);
    --accent: oklch(0.78 0.11 160);
    --on-accent: oklch(0.17 0.012 160);
    --border: oklch(0.54 0.018 160);
    --error: oklch(0.82 0.10 25);
    --error-bg: oklch(0.24 0.025 25);
    --focus: oklch(0.78 0.11 160);
  }
}
* { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 100%; line-height: 1.6; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-underline-offset: 0.2em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
main:focus, .preview:focus { outline: none; }
button, input, textarea { font: inherit; }
button, .button, summary { touch-action: manipulation; cursor: pointer; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.6rem 1rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--ink); font-weight: 600; line-height: 1.4; text-decoration: none; text-align: center; transition: background-color 160ms ease-out, border-color 160ms ease-out; }
button:hover, .button:hover { background: var(--surface); border-color: var(--accent); }
button:active, .button:active { opacity: 0.8; }
button:disabled { opacity: 0.6; cursor: wait; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.primary:hover { background: var(--accent); color: var(--on-accent); text-decoration: underline; }
.quiet { background: transparent; border-color: transparent; font-weight: 400; color: var(--muted); }
.danger { color: var(--error); border-color: var(--error); }
.skip { position: absolute; top: 0.5rem; left: 1rem; transform: translateY(-180%); padding: 0.7rem 1rem; background: var(--bg); z-index: 1; }
.skip:focus { transform: none; }
.site-header, main, .site-footer { width: min(100% - 3rem, 68rem); margin-inline: auto; }
.site-header { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); }
.wordmark { color: var(--ink); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.035em; text-decoration: none; }
.wordmark span { color: var(--accent); }
nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.95rem; }
nav [aria-current] { color: var(--ink); font-weight: 650; text-decoration: none; }
nav form { margin: 0; }
main { min-height: calc(100dvh - 230px); padding-block: 3rem 5rem; }
.site-footer { padding-block: 1.5rem 2rem; border-top: 1px solid var(--border); display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 2rem; color: var(--muted); font-size: 0.875rem; }
.site-footer p { margin: 0; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; overflow-wrap: anywhere; }
h1 { font-size: 2rem; letter-spacing: -0.03em; margin: 0 0 1.5rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }
p { max-width: 70ch; text-wrap: pretty; }
.intro { max-width: 43rem; padding-block: 1.5rem 4rem; }
.intro h1 { font-size: 3.5rem; line-height: 1.05; margin-bottom: 1.75rem; }
.intro-line { font-weight: 600; color: var(--accent); margin-bottom: 1.5rem; }
.lead { font-size: 1.25rem; line-height: 1.6; margin-bottom: 2rem; }
.lead.small { font-size: 1.125rem; }
.principles { display: flex; gap: 2.5rem; border-top: 1px solid var(--border); padding-top: 2rem; }
.principles > div { flex: 1; min-width: 0; }
.principles p { color: var(--muted); margin: 0; }
.narrow { max-width: 32rem; margin-inline: auto; }
.back { display: inline-flex; min-height: 44px; align-items: center; margin-bottom: 1.5rem; font-size: 0.9rem; }
.field { margin-bottom: 1.5rem; }
label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
input:not([type="hidden"]):not([type="checkbox"]), textarea { display: block; width: 100%; min-height: 48px; padding: 0.75rem; background: var(--bg); color: var(--ink); border: 1px solid var(--border); border-radius: 4px; }
textarea { resize: vertical; min-height: 8rem; }
input:focus, textarea:focus { border-color: var(--accent); }
.address-input { display: flex; align-items: stretch; }
.address-input > span { display: inline-flex; align-items: center; padding-inline: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-inline-end: 0; border-radius: 4px 0 0 4px; font-size: 0.9rem; }
.address-input > input { border-radius: 0 4px 4px 0 !important; min-width: 0; }
.help { font-size: 0.875rem; color: var(--muted); margin-block: 0.5rem 0; }
.subtle { color: var(--muted); font-weight: 400; }
.address, code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.notice { padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); margin: 0 0 2rem; max-width: none; }
.notice.error { color: var(--error); background: var(--error-bg); border-color: var(--error); }
.recovery-code { display: block; padding: 1.5rem; border: 1px solid var(--accent); background: var(--surface); font-size: 1.2rem; line-height: 1.8; user-select: all; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.page-heading h1 { margin: 0; }
.page-heading p { margin-block: 0 0.5rem; font-size: 0.875rem; }
.writing-list { list-style: none; padding: 0; margin: 0; }
.writing-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem 2rem; padding-block: 1.5rem; border-top: 1px solid var(--border); }
.writing-list li > div { min-width: 0; }
.post-title { font-size: 1.25rem; font-weight: 650; color: var(--ink); }
.status { font-size: 0.875rem; color: var(--muted); }
.writing-list .status { flex-shrink: 0; }
.empty { border-block: 1px solid var(--border); padding-block: 3rem; }
.empty p { margin-block: 1rem 1.5rem; color: var(--muted); }
.empty a { display: inline-flex; align-items: center; min-height: 44px; }
.editor { max-width: 52rem; margin-inline: auto; }
.editor .title-input { font-size: 1.5rem; font-weight: 600; }
#markdown { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.75; min-height: 24rem; tab-size: 2; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.editor-actions .primary { margin-inline-start: auto; }
.post-controls { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
summary { min-height: 44px; align-content: center; color: var(--muted); }
.post-controls > button { margin-top: 1rem; }
.delete-control { margin-top: 2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.checkbox { display: flex; align-items: center; min-height: 44px; gap: 0.75rem; font-size: 0.9rem; font-weight: 400; margin: 0; }
.checkbox input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.preview { margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 2rem; scroll-margin-top: 1rem; }
.preview > h2 { font-size: 2rem; }
.prose { font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif; font-size: 1.125rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose h2, .prose h3, .prose h4 { font-family: system-ui, sans-serif; margin-top: 2rem; }
.prose pre { overflow: auto; padding: 1rem; background: var(--surface); font-size: 0.9rem; }
.prose pre code { overflow-wrap: normal; }
.prose blockquote { margin-inline: 0; padding: 1rem; background: var(--surface); }
.settings { max-width: 40rem; margin-inline: auto; }
.settings-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .site-header, main, .site-footer { width: calc(100% - 2rem); }
  .site-header { min-height: 80px; flex-wrap: wrap; padding-block: 1rem; }
  nav { justify-content: flex-start; gap: 0.25rem 0.75rem; }
  nav a, nav button { font-size: 0.875rem; }
  nav .quiet { padding-inline: 0.25rem; }
  main { padding-block: 2rem 3rem; }
  .intro { padding-top: 0.5rem; }
  .intro h1 { font-size: 2.75rem; }
  .principles { flex-direction: column; gap: 1.5rem; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; }
  .writing-list li { flex-direction: column; gap: 0.75rem; }
  .editor-actions .primary { margin-inline-start: 0; }
  .recovery-code { padding: 1rem; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
