:root {
  color-scheme: light;
  --paper: #f7f6f1;
  --ink: #232128;
  --muted: #605c68;
  --line: #d6d1da;
  --surface: #fffdfa;
  --wash: #edebf6;
  --accent: #3e307d;
  --accent-hover: #302465;
  --accent-ink: #fffdfb;
  --masthead: #ded8f5;
  --masthead-ink: #291f53;
  --danger: #942d3a;
  --danger-bg: #f7e7e9;
  --display: Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #19171f;
  --ink: #f1eef5;
  --muted: #bbb4c6;
  --line: #443c51;
  --surface: #211e28;
  --wash: #292438;
  --accent: #d1c3fb;
  --accent-hover: #e4dbff;
  --accent-ink: #261b47;
  --masthead: #332652;
  --masthead-ink: #f2eaff;
  --danger: #ffbcc4;
  --danger-bg: #40272d;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --paper: #19171f;
    --ink: #f1eef5;
    --muted: #bbb4c6;
    --line: #443c51;
    --surface: #211e28;
    --wash: #292438;
    --accent: #d1c3fb;
    --accent-hover: #e4dbff;
    --accent-ink: #261b47;
    --masthead: #332652;
    --masthead-ink: #f2eaff;
    --danger: #ffbcc4;
    --danger-bg: #40272d;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-block-start: 1.5rem; }
body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--body);
}
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, p, figure { margin: 0; }
h1, h2 { overflow-wrap: anywhere; }
h1, h2, .wordmark strong { font-family: var(--display); font-weight: 600; }
h1 {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -.05em;
}
h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); line-height: 1.15; letter-spacing: -.035em; }
time, .muted { color: var(--muted); }
time, .field-note { font-size: .875rem; }
.frame { max-width: 76rem; width: calc(100% - 6rem); margin-inline: auto; }

.skip {
  position: fixed;
  z-index: 1;
  inset: .5rem auto auto .5rem;
  padding: .5rem 1rem;
  background: var(--surface);
  transform: translateY(-160%);
}
.skip:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.header-inner { min-height: 5.25rem; padding-block: .875rem; }
.wordmark { display: grid; text-decoration: none; }
.wordmark strong { font-size: 1.5rem; line-height: 1.15; letter-spacing: -.035em; }
.wordmark span { margin-top: .125rem; color: var(--muted); font-size: .8125rem; }
.site-nav, .footer-inner nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav > a:not(.button) { text-decoration: none; }
.site-nav .nav-feed[aria-current] { text-decoration: underline; }
.theme-switch {
  padding: .375rem 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
}
.theme-switch:hover, .theme-switch[aria-pressed="true"] { color: var(--accent); }
.theme-switch[aria-pressed="true"] { text-decoration: underline; text-underline-offset: .25em; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  min-height: 2.875rem;
  padding: .625rem 1rem;
  border: 1px solid transparent;
  border-radius: .25rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}
.button:hover { background: var(--accent-hover); color: var(--accent-ink); }
.button-small { min-height: 2.5rem; }
.button.secondary { border-color: var(--line); background: transparent; color: var(--ink); }
.button.secondary:hover, .button.secondary.selected { background: var(--wash); color: var(--accent); border-color: var(--accent); }
.button:disabled { cursor: default; }
.button:disabled:not(.selected):hover { background: transparent; border-color: var(--line); color: var(--ink); }
.main { flex: 1; padding-block: 2.5rem 5rem; }

.masthead {
  background: var(--masthead);
  color: var(--masthead-ink);
  padding: clamp(1.5rem, 5vw, 4rem);
}
.masthead h1 {
  font-size: clamp(3.125rem, 9.5vw, 8rem);
  line-height: .96;
  letter-spacing: -.065em;
}
.masthead-compact { padding-block: clamp(1.5rem, 3.5vw, 3rem); }
@media (min-width: 62rem) {
  .masthead-compact h1 { font-size: clamp(4.5rem, 7vw, 6.5rem); }
  .masthead-compact h1 br { display: none; }
}
.empty-feed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 1rem 2rem;
  margin-top: 2rem;
  padding: 1.75rem 0 2rem;
  border-block: 1px solid var(--line);
}
.empty-feed p { max-width: 34ch; color: var(--muted); }
.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  margin-top: 2rem;
}
.lead-text { grid-template-columns: 1fr; }
.lead-text .lead-copy { max-width: 52rem; }
.lead-photo, .card-photo { display: block; background: var(--wash); }
.lead-photo { min-height: 17rem; position: relative; }
.lead-photo img { width: 100%; height: 100%; object-fit: cover; position: absolute; }
.lead-copy { display: grid; gap: 1rem; align-content: center; padding: clamp(1.25rem, 4vw, 3rem); }
.lead h2 { font-size: clamp(1.875rem, 4.25vw, 3.5rem); }
.lead h2 a, .feed-card h2 a { text-decoration: none; }
.lead h2 a:hover, .feed-card h2 a:hover { text-decoration: underline; }
.lead-copy p, .feed-card p { color: var(--muted); overflow-wrap: anywhere; }
.stats { display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--muted); font-size: .8125rem; }
.stat-value { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.feed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; margin-top: 2rem; }
.feed-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}
.feed-card h2 { font-size: 1.625rem; }
.feed-card .stats { margin-top: auto; }
.card-photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.5rem; color: var(--muted); }

.narrow, .article, .comments { max-width: 46rem; margin-inline: auto; }
.narrow h1, .article-head h1 { margin-bottom: 1rem; }
.intro { color: var(--muted); margin: 0 0 1.5rem; }
.stack { display: grid; justify-items: start; gap: 1.25rem; }
.field { width: 100%; display: grid; gap: .375rem; }
.field label { font-weight: 600; }
.field-note { color: var(--muted); }
input:not([type="hidden"]), textarea {
  width: 100%;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .25rem;
  padding: .75rem;
}
textarea { min-height: 7rem; resize: vertical; }
input::file-selector-button {
  margin-inline-end: .75rem;
  border: 1px solid var(--line);
  background: var(--wash);
  color: var(--ink);
  border-radius: .25rem;
  padding: .375rem .625rem;
  font: inherit;
  cursor: pointer;
}
.notice { background: var(--wash); border: 1px solid var(--line); padding: .75rem 1rem; margin-bottom: 1rem; }
.notice.error { background: var(--danger-bg); color: var(--danger); }
.login { max-width: 32rem; }

.article-head { margin-bottom: 1.5rem; }
.article-meta, .comment-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem 1.25rem; }
.article-meta { color: var(--muted); font-size: .875rem; }
.article-image { background: var(--wash); display: grid; place-items: center; margin-bottom: 1.5rem; }
.article-image img { max-height: 42rem; object-fit: contain; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.article-body { font-size: 1.125rem; line-height: 1.75; }
.reaction-area { margin-top: 2rem; }
.reaction-form, .moderation-actions { display: flex; flex-wrap: wrap; gap: .625rem; }
.feedback { margin-top: .75rem; color: var(--muted); }
.comments { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.5rem; }
.comments > h2 { margin-bottom: 1rem; }
.comments > h2 span { color: var(--muted); font: 1rem var(--body); }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.comment-meta { margin-bottom: .25rem; }
.comment-form { margin-top: 1.5rem; }

.moderation-head { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: .75rem; }
.moderation-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; border-bottom: 1px solid var(--line); margin-block: 1rem; }
.moderation-nav a { padding-block: .5rem; text-decoration: none; border-bottom: 2px solid transparent; }
.moderation-nav a[aria-current] { color: var(--accent); border-color: var(--accent); }
.moderation-nav span { font-size: .875rem; margin-left: .25rem; color: var(--muted); }
.moderation-item { display: grid; gap: .75rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.pending-image img { max-height: 16rem; object-fit: contain; }
.empty-admin { color: var(--muted); }
.policy h2 { margin-top: 1.5rem; }
.policy p { margin-top: .625rem; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { padding-block: 1.25rem; font-size: .875rem; }
.footer-year { margin-left: .5rem; }
.footer-inner nav a { text-decoration: none; }
.footer-inner nav a:hover { text-decoration: underline; }

@media (max-width: 57rem) {
  .frame { width: calc(100% - 3rem); }
  .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
  .frame { width: calc(100% - 2rem); }
  .header-inner { gap: .75rem; }
  .site-nav { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: .5rem .75rem; }
  .site-nav .nav-feed { display: none; }
  .main { padding-block: 1.5rem 3rem; }
  .empty-feed, .lead, .feed-grid { grid-template-columns: 1fr; }
  .lead-photo { min-height: 0; }
  .lead-photo img { position: static; aspect-ratio: 16 / 10; }
  .feed-card, .feed-grid { gap: .75rem; }
}
