/* Daily Scroll — a calm, warm town square. System fonts only; no third-party assets. */
:root {
  --paper: #fbf7f0;
  --card: #ffffff;
  --ink: #2b2620;
  --muted: #5e554b;
  --line: #e3d9cb;
  --accent: #8a4b1f;        /* warm brown: 7.0:1 on paper */
  --accent-ink: #ffffff;
  --open: #1f5f3f;          /* 7.4:1 on its tint */
  --open-tint: #e4f2e8;
  --closed: #4d4363;
  --closed-tint: #ece8f3;
  --error: #9b1c1c;
  --error-tint: #fdeceb;
  --success: #1f5f3f;
  --focus: #1b4ea8;
  --radius: 10px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap, .clock-inner { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 1rem; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1:focus, h2:focus, article:focus, main:focus { outline: none; }
h1:focus-visible, h2:focus-visible, article:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--card); padding: .5rem 1rem; border: 2px solid var(--focus); z-index: 10; }
.skip-link:focus { top: .5rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; padding-top: .6rem; padding-bottom: .6rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .1rem .9rem; margin: 0; padding: 0; }
.site-nav a { display: inline-block; padding: .35rem .1rem; min-height: 24px; color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; }

/* Clock banner: the centre of the experience */
.clock { border-bottom: 1px solid var(--line); background: #f4ece0; }
.clock-inner { padding-top: 1rem; padding-bottom: 1rem; }
.clock-title { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.clock-state { margin: .3rem 0 .2rem; font-size: 1.1rem; font-weight: 600; }
.clock-detail { margin: 0; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock-detail:empty { display: none; }
.clock-schedule { margin: .4rem 0 0; color: var(--muted); font-size: .9rem; }
.clock[data-phase="open"] { background: var(--open-tint); }
.clock[data-phase="open"] .clock-state::before { content: "● "; color: var(--open); }
.clock[data-phase="closed"] { background: var(--closed-tint); }
.clock[data-phase="closed"] .clock-state::before { content: "○ "; color: var(--closed); }

/* Page */
main { padding-top: 1.5rem; padding-bottom: 3rem; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 1.5rem 0 .5rem; }
.lede { color: var(--muted); margin-top: 0; }
.hint { color: var(--muted); font-size: .9rem; margin: .1rem 0 .4rem; }

.note { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--closed); border-radius: var(--radius); padding: .75rem 1rem; margin: 1rem 0; }
.note h2 { margin-top: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.card h2 { margin-top: 0; }

/* Forms */
.composer, .kept, .welcome, .rules-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.composer h2, .kept h2, .rules-box h2 { margin-top: 0; }
.field { margin: .5rem 0; }
.label { display: block; font-weight: 600; margin-bottom: .1rem; }
.textarea, .input {
  display: block; width: 100%; font: inherit; color: var(--ink); background: #fffdf9;
  border: 2px solid #8c8174; border-radius: 8px; padding: .55rem .65rem;
}
.textarea { resize: vertical; min-height: 4.5rem; }
.textarea[readonly] { background: #f3eee6; }
.textarea[aria-invalid="true"], .input[aria-invalid="true"] { border-color: var(--error); }
.count { margin: .25rem 0 0; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.over { color: var(--error); font-weight: 600; }
.msg { margin: .4rem 0 0; }
.msg:empty { display: none; }
.msg[data-tone="error"] { color: var(--error); background: var(--error-tint); padding: .5rem .7rem; border-radius: 6px; }
.msg[data-tone="success"] { color: var(--success); font-weight: 600; }
.msg.error { color: var(--error); background: var(--error-tint); padding: .5rem .7rem; border-radius: 6px; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: .5rem 0; padding: .5rem .75rem; }
legend { font-weight: 600; padding: 0 .25rem; }
.radio, .check { display: flex; align-items: flex-start; gap: .5rem; margin: .35rem 0; }
.radio input, .check input { width: 1.2rem; height: 1.2rem; margin-top: .2rem; flex: none; }
.rules { padding-left: 1.4rem; }
.rules li { margin: .25rem 0; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem 1rem;
  font: inherit; font-weight: 600; border-radius: 8px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
}
.button:hover { background: #723d18; border-color: #723d18; }
.button.primary { background: var(--accent); }
.button.secondary { background: var(--card); color: var(--accent); }
.button.secondary:hover { background: #f7eee4; }
.button.danger { background: var(--error); border-color: var(--error); color: #fff; }
.button.danger:hover { background: #7f1616; }
.button.small { min-height: 36px; padding: .25rem .7rem; font-size: .92rem; }
.button[disabled] { opacity: .65; cursor: progress; }
.linklike { background: none; border: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Feed */
.feed-title { margin-top: 2rem; }
.feed-status:empty { display: none; }
.feed, .replies, .archive-list, .blocked-list { list-style: none; margin: 0; padding: 0; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: .75rem 0; }
.meta { margin: 0; color: var(--muted); font-size: .92rem; }
.author { color: var(--ink); font-weight: 600; }
.you { font-weight: 400; color: var(--muted); }
.body { margin: .3rem 0 .4rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.panel { margin-top: .6rem; padding: .6rem .75rem; border-radius: 8px; background: #faf5ee; border: 1px solid var(--line); }
.replies { margin-top: .6rem; border-left: 3px solid var(--line); padding-left: .8rem; }
.reply { padding: .4rem 0; }
.replies > li + li { border-top: 1px dashed var(--line); }
.reply-form, .reply-area .kept { margin-top: .6rem; }
.reply-area .kept { padding: .75rem; }
.load-more { margin-top: 1rem; }
.archive-list li, .blocked-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.confirm { margin-top: .75rem; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 1rem 0 2rem; }

@media (max-width: 480px) {
  h1 { font-size: 1.45rem; }
  .clock-detail { font-size: 1.35rem; }
  .post { padding: .7rem .75rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media (forced-colors: active) { .clock-state::before { forced-color-adjust: auto; } }

[hidden] { display: none !important; }

/* Privacy notice (P7). The DRAFT banner stays until the founder approves the text (F42). */
.draft-banner { border: 2px solid var(--error); background: var(--error-tint); color: var(--ink); padding: .6rem .9rem; border-radius: var(--radius); }
.draft-banner strong { color: var(--error); letter-spacing: .06em; }
.notice h2 { margin-top: 1.6rem; font-size: 1.15rem; }
.notice code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95em; background: #f4ece0; padding: 0 .2em; border-radius: 3px; }
.notice .placeholder { background: #fff3c4; color: var(--ink); padding: 0 .15em; border-radius: 3px; }
.site-footer a { color: var(--accent); }
.notice h1 .draft-marker { color: var(--error); font-size: .7em; font-weight: 600; white-space: nowrap; }
