/* Public theme "Meadow": cream paper, serif reading text, Biscuit & Mochi in the margins only.
   The private journal has its own, deliberately opposite, sheet. */

:root {
  --bg: #fffaf3;
  --fg: #3a2e28;
  --muted: #8a7d72;
  --rule: #efe4d6;
  --accent: #c8694f;
  --sage: #8fac8d;
  --field: #ffffff;
  --notice: #f7efe4;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --column: 680px;
  --tap: 44px;

  /* Biscuit (pony) */
  --coat: #f4d9b8; --coat-shade: #e6c29b; --mane: #8b5e3c; --muzzle: #fff3e4;
  --ear-inner: #f6b8a8; --eye: #3a2e28; --blush: #f4a5a0; --hoof: #6f4a35;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1915;
    --fg: #efe4d6;
    --muted: #a8998a;
    --rule: #372d26;
    --accent: #e89a80;
    --sage: #9dbb9a;
    --field: #29211c;
    --notice: #2a221d;
    --coat: #e4c49f; --coat-shade: #cfa97f; --mane: #9a6a45; --muzzle: #f6e6d2; --eye: #2a1f19;
  }
}

/* Mochi (bunny) wears oat-milk white wherever she appears. */
.footer-bunny { --coat: #f3ece4; --coat-shade: #e2d6c8; --muzzle: #fffaf5; --ear-inner: #f4b6b6; }
@media (prefers-color-scheme: dark) {
  .footer-bunny { --coat: #e9e1d8; --coat-shade: #d3c5b6; --muzzle: #f8f2ec; --eye: #2a1f19; }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 20px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (max-width: 480px) { html { font-size: 18px; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

main, .site-header, .site-footer {
  max-width: var(--column);
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

/* ---- header / footer ---- */

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-top: max(16px, env(safe-area-inset-top));
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--rule);
  font-family: var(--sans);
}
.brand { display: flex; align-items: flex-end; text-decoration: none; min-width: 0; }
.brand-pony { width: 92px; height: 55px; margin: 0 -10px -2px -16px; flex: none; }
.site-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  padding-bottom: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand:hover .brand-pony { animation: nod 600ms ease-in-out; transform-origin: 50% 90%; }
.owner-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--tap);
  padding: 0 0.95rem;
  margin-bottom: 8px;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  text-decoration: none;
  letter-spacing: 0.02em;
  flex: none;
}
.owner-button .icon { width: 14px; height: 14px; color: var(--sage); --hole: var(--bg); }
.owner-button:hover { color: var(--fg); border-color: var(--muted); }

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 5rem;
  padding-top: 1.2rem;
  padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
  border-top: 1.5px dashed var(--rule);
  font-family: var(--sans);
  font-size: 0.65rem;
  color: var(--muted);
}
.footer-bunny { width: 64px; height: 64px; margin-bottom: -6px; }
.footer-bunny:hover { animation: hop 500ms ease-out; }

@keyframes nod { 30% { transform: rotate(-6deg); } 60% { transform: rotate(4deg); } }
@keyframes hop { 40% { transform: translateY(-10px); } }

/* ---- home ---- */

.site-description { color: var(--muted); font-style: italic; margin: 0 0 2rem; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li + li { border-top: 1.5px dashed var(--rule); }
.post-card {
  display: block;
  padding: 1.4rem 0;
  text-decoration: none;
}
.post-card h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.post-card:hover h2 { color: var(--accent); }
.post-card .subtitle { margin: 0.3rem 0 0; color: var(--muted); }
.post-card .meta { display: block; margin-top: 0.5rem; }

.meta, .hint, .comment-meta {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted);
}
.empty { color: var(--muted); font-style: italic; }

/* ---- post ---- */

.post header { margin-bottom: 2.2rem; }
.post h1 {
  font-size: 2.2rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.post .subtitle { font-size: 1.15rem; color: var(--muted); margin: 0 0 1rem; line-height: 1.4; }

.prose { overflow-wrap: break-word; hyphens: auto; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose figure, .prose table { margin-bottom: 0; }
.prose h2, .prose h3, .prose h4 { line-height: 1.25; margin-top: 2em; margin-bottom: 0; letter-spacing: -0.01em; }
.prose h2 { font-size: 1.45rem; }
.prose h3 { font-size: 1.2rem; }
.prose img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 4px; }
.prose blockquote { margin-left: 0; padding-left: 1.1rem; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.prose hr {
  border: 0; height: 22px; margin: 2.5em auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 24'%3E%3Cpath d='M10 20V11a6 6 0 0 1 12 0v9M74 20V11a6 6 0 0 1 12 0v9' stroke='%238fac8d' stroke-width='3.2' fill='none' stroke-linecap='round'/%3E%3Cpath d='M42 20l10-11q3-2 1-4t-4 1z' fill='%23f08a4b'/%3E%3Cpath d='M52 6q3-4 5-3M53 7q4-1 5 1' stroke='%236aa36f' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center / 96px 22px no-repeat;
}
.prose code { font-family: var(--mono); font-size: 0.82em; background: var(--notice); padding: 0.1em 0.3em; border-radius: 4px; }
.prose pre { font-size: 0.8rem; background: var(--notice); padding: 1rem; overflow-x: auto; border-radius: 6px; line-height: 1.45; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.85rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 0.4rem 0.6rem; text-align: left; }
.prose .footnotes { font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1rem; }
.prose .footnotes hr { display: none; }
.prose sup a { text-decoration: none; padding: 0 0.15em; }

.preview-banner {
  font-family: var(--sans);
  font-size: 0.75rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.7rem 1rem;
  border-radius: 6px;
  margin: 0 0 2rem;
}

/* ---- comments ---- */

.comments { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.comments h2 { font-family: var(--sans); font-size: 0.9rem; letter-spacing: 0.02em; color: var(--muted); margin: 0 0 1.5rem; }

.comment { padding: 1rem 0; }
.comment + .comment { border-top: 1px solid var(--rule); }
.comment-meta { margin: 0 0 0.3rem; }
.comment-meta strong { color: var(--fg); font-weight: 600; }
.comment-body p { margin: 0 0 0.6em; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-owner .comment-meta strong { color: var(--accent); }
.badge { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; border: 1px solid currentColor; border-radius: 4px; padding: 0 0.3em; }

.notice {
  font-family: var(--sans);
  font-size: 0.8rem;
  background: var(--notice);
  padding: 0.8rem 1rem;
  border-radius: 6px;
}
.notice-error { border-left: 3px solid var(--accent); }

.comment-form { display: grid; gap: 1rem; margin-top: 2rem; font-family: var(--sans); font-size: 0.8rem; }
.comment-form label { display: grid; gap: 0.35rem; font-weight: 600; }
.comment-form .hint { font-weight: 400; }
.comment-form input, .comment-form textarea {
  font: inherit;
  font-size: max(16px, 0.85rem); /* ≥16px stops iPad Safari zooming on focus */
  font-weight: 400;
  color: var(--fg);
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  min-height: var(--tap);
  width: 100%;
}
.comment-form textarea { font-family: var(--serif); line-height: 1.5; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--muted); outline: none; }
.comment-form button {
  justify-self: start;
  min-height: var(--tap);
  padding: 0 1.4rem;
  font: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--fg);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.comment-form button:hover { background: var(--accent); }

/* Honeypot: off-screen for people, present for naive bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- 404 / messages ---- */

.message { padding: 3rem 0; }
.message h1 { font-size: 1.8rem; margin: 0 0 0.5rem; }
.message p { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .brand:hover .brand-pony, .footer-bunny:hover { animation: none; }
}
@media (prefers-reduced-motion: no-preference) {
  a, .owner-button, .comment-form button { transition: color 120ms, background-color 120ms, border-color 120ms; }
}
