:root {
  --paper: #f5edd8;
  --ink: #2e2a22;
  --muted: #665e4d;
  --rule: #d6caa8;
  --button: #3a352b;
  --buttonText: #f8f2e0;
  --field: rgba(255,252,240,.38);
  /* Paper texture, drawn in CSS: fine grain plus very faint mottling. */
  --grain: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27260%27%20height%3D%27260%27%3E%3Cfilter%20id%3D%27g%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27100%25%27%20height%3D%27100%25%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%27.85%27%20numOctaves%3D%272%27%20seed%3D%274%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20values%3D%270%200%200%200%20.42%20%200%200%200%200%20.31%20%200%200%200%200%20.13%20%200%200%200%20.20%200%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20filter%3D%27url%28%23g%29%27%2F%3E%3C%2Fsvg%3E");
  --mottle: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27900%27%20height%3D%27900%27%3E%3Cfilter%20id%3D%27m%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27100%25%27%20height%3D%27100%25%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%27.006%20.009%27%20numOctaves%3D%273%27%20seed%3D%279%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20values%3D%270%200%200%200%20.55%20%200%200%200%200%20.40%20%200%200%200%200%20.14%20%200%200%200%20.17%200%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20filter%3D%27url%28%23m%29%27%2F%3E%3C%2Fsvg%3E");
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
html {
  background-color: var(--paper);
  background-image: var(--grain), var(--mottle);
  background-size: 260px 260px, 900px 900px;
}
body { min-height: 100vh; background: transparent; }
/* Soft aging toward the edges of the screen; stays put while the page scrolls. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(255,251,236,.40) 0%, rgba(255,251,236,0) 55%, rgba(130,95,35,.08) 100%);
}
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

#loginScreen, #noticeScreen {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 30px;
}
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { font-size: 32px; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 32px; }
.login-box input {
  width: 100%; border: 0; border-bottom: 1px solid var(--ink);
  border-radius: 0; padding: 12px 0; background: transparent;
  outline: none; color: var(--ink); font-size: 17px;
}
.login-box button { margin-top: 25px; }

#site { width: 100%; max-width: 720px; margin: 0 auto; padding: 48px 24px 100px; }
/* Title + welcome, closed off from the posts by a heavier rule than the one between posts. */
.masthead { padding-bottom: 36px; margin-bottom: 52px; border-bottom: 2px solid var(--ink); }
header {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 20px;
}
header h1 { font-size: 34px; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; margin: 0; min-height: 1.15em; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.login-box h1 { min-height: 1.15em; }
.welcome { margin-top: 28px; max-width: 34em; font-size: 17px; line-height: 1.65; font-weight: 500; color: #1a170f; overflow-wrap: anywhere; }
.welcome p { margin: 0 0 1em; }
.welcome p:last-child { margin-bottom: 0; }
.header-actions { display: flex; gap: 18px; align-items: center; flex: none; white-space: nowrap; }
.text-button {
  border: 0; padding: 0; background: transparent; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.logout { color: var(--muted); font-size: 13px; }
.more-button { margin-top: 8px; }
a.text-button { color: var(--ink); }
.text-button.subtle { color: var(--muted); font-size: 14px; }
.masthead-tools { margin-top: 22px; }
/* The email-alerts panel lives inside the header block, so the heavy rule closes it. */
.masthead .form-panel { border: 0; border-top: 1px solid var(--rule); margin: 30px 0 0; padding: 30px 0 0; }
.notice-text { font-size: 17px; line-height: 1.65; margin: 0 0 24px; }

.post {
  padding: 0 0 42px; margin: 0 0 42px;
  border-bottom: 1px solid var(--rule);
}
.post-date {
  color: var(--muted); font-size: 12px; letter-spacing: .07em;
  text-transform: uppercase; margin-bottom: 7px;
}
.post-author { font-size: 14px; font-weight: 600; margin-bottom: 25px; }
.post-title { font-size: 23px; line-height: 1.25; font-weight: 500; margin: 0 0 16px; }
.post-body { font-size: 17px; line-height: 1.65; overflow-wrap: anywhere; }
.post-body p, .comment-body p { margin: 0 0 1em; }
.post-body p:last-child, .comment-body p:last-child { margin-bottom: 0; }

.responses { margin-top: 32px; }
.responses-heading { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.comment {
  margin: 0 0 24px 22px; padding-left: 16px;
  border-left: 1px solid var(--rule);
}
.comment-meta { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.comment-name { color: var(--ink); font-weight: 600; }
.comment-body { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.respond-button { margin-top: 18px; }
.comment-form { margin-top: 24px; }

.form-panel {
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  padding: 30px 0; margin: 0 0 55px;
}
.form-panel h2 { font-size: 21px; font-weight: 500; margin: 0 0 28px; }
.form-note { font-size: 15px; line-height: 1.6; color: var(--muted); margin: -8px 0 26px; max-width: 34em; }
.field { margin-bottom: 24px; }
label.check {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px;
  font-size: 16px; color: var(--ink); text-transform: none; letter-spacing: 0; cursor: pointer;
}
input[type="checkbox"] { width: 18px; height: 18px; margin: 3px 0 0; flex: none; accent-color: var(--ink); }
.form-panel .check + .primary-button, .form-panel .check:last-of-type + .primary-button { margin-top: 12px; }
label {
  display: block; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px;
}
input[type="text"] {
  width: 100%; border: 0; border-bottom: 1px solid var(--rule);
  background: transparent; padding: 8px 0 10px; outline: none;
  color: var(--ink); font-size: 16px; border-radius: 0;
}
input[type="text"]:focus { border-color: var(--ink); }

.editor-shell { border: 1px solid var(--rule); background: var(--field); }
.toolbar { display: flex; gap: 3px; padding: 7px; border-bottom: 1px solid var(--rule); }
.toolbar button {
  width: 34px; height: 30px; border: 0; background: transparent;
  color: var(--ink); font-size: 15px;
}
.toolbar button:hover { background: rgba(0,0,0,.05); }
.editor {
  min-height: 150px; padding: 14px; outline: none;
  line-height: 1.55; font-size: 16px;
}
.comment-editor { min-height: 100px; }
.editor:empty:before {
  content: attr(data-placeholder); color: #7d7561; pointer-events: none;
}

.primary-button {
  border: 0; background: var(--button); color: var(--buttonText);
  padding: 11px 18px; border-radius: 2px;
}
.primary-button:disabled { opacity: .45; cursor: default; }
.secondary-button {
  border: 0; background: transparent; color: var(--ink); padding: 10px 0;
  margin-left: 18px; text-decoration: underline; text-underline-offset: 3px;
}

.error { color: #7a302c; font-size: 14px; margin-top: 14px; }
.status { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 14px; }
.empty { color: var(--muted); font-size: 16px; }

@media (max-width: 600px) {
  #site { padding: 32px 20px 80px; }
  .masthead { padding-bottom: 28px; margin-bottom: 40px; }
  header h1 { font-size: 28px; }
  .login-box h1 { font-size: 28px; }
  .welcome { font-size: 16px; }
  .post-title { font-size: 21px; }
  .post-body { font-size: 16px; }
  .header-actions { gap: 12px; }
  .comment { margin-left: 8px; }
}
