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

:root {
  --bg:      #b8a888;
  --paper:   #f4ead6;
  --text:    #1e0e00;
  --muted:   #7a5a35;
  --accent:  #8b3800;
  --border:  #8b6b45;
  --font:    'Courier New', Courier, monospace;
}

html { font-size: 16px; }

body {
  background-color: var(--bg);
  /* crosshatch texture */
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.06) 0 1px, transparent 1px 100%),
    repeating-linear-gradient(0deg,  rgba(0,0,0,0.06) 0 1px, transparent 1px 100%);
  background-size: 12px 12px;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  padding: 2.5rem 1rem 4rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Page box ── */

.page {
  max-width: 680px;
  margin: 0 auto;
  background: var(--paper);
  border: 2px solid var(--border);
  box-shadow: 6px 6px 0 var(--border);
  padding: 2.5rem 2.5rem 3rem;
}

/* ── Site header ── */

.site-header {
  text-align: center;
  margin-bottom: 2rem;
}

.site-header-rule {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  margin-bottom: 0.9rem;
}

.site-name {
  font-size: 1.25rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.35;
}

.site-name a {
  color: var(--text);
  text-decoration: none;
}

.site-name a:hover { color: var(--accent); }

.site-tagline {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.header-divider {
  margin-top: 1.1rem;
  border: none;
  border-top: 2px solid var(--border);
}

/* ── Section label ── */

.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* ── Prompt list (homepage) ── */

.prompt-list { list-style: none; }

.prompt-item { border-bottom: 1px dashed var(--border); }
.prompt-item:first-child { border-top: 1px dashed var(--border); }

.prompt-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.85rem 0;
  text-decoration: none;
  color: var(--accent);
}

.prompt-link:hover .prompt-title { text-decoration: underline; }

.prompt-title::before {
  content: '>> ';
  color: var(--muted);
}

.prompt-title { font-size: 0.95rem; }

.prompt-right {
  text-align: right;
  flex-shrink: 0;
}

.prompt-meta  { display: block; font-size: 0.72rem; color: var(--muted); }
.prompt-count { display: block; font-size: 0.7rem;  color: var(--muted); }

/* ── Prompt page ── */

.back-link {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.back-link::before { content: '<< '; }
.back-link:hover { color: var(--accent); text-decoration: underline; }

.prompt-heading {
  font-size: 1.15rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.35;
}

.prompt-date {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

.prompt-page-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
}

/* ── Submission list ── */

.submission-list { list-style: none; }

.submission-item { border-bottom: 1px dashed var(--border); }
.submission-item:first-child { border-top: 1px dashed var(--border); }

.submission-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 0;
  text-decoration: none;
  color: var(--accent);
}

.submission-link:hover .submission-title { text-decoration: underline; }

.submission-title::before {
  content: '>> ';
  color: var(--muted);
}

.submission-title  { font-size: 0.95rem; }
.submission-author { font-size: 0.75rem; color: var(--muted); flex-shrink: 0; white-space: nowrap; }

/* ── Footer ── */

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.1em;
}

/* ── Misc ── */

.empty { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; }
.error { font-size: 0.85rem; color: var(--accent); margin-top: 1rem; }

/* ── Mobile ── */

@media (max-width: 640px) {
  html { font-size: 14px; }

  body {
    padding: 0 0 3rem;
    overflow-x: hidden;
  }

  .page {
    border-left: none;
    border-right: none;
    box-shadow: none;
    padding: 1.5rem 1.25rem 2rem;
  }

  .site-name {
    font-size: 1rem;
    letter-spacing: 0.05em;
  }

  .prompt-link,
  .submission-link {
    flex-wrap: wrap;
    gap: 0.1rem;
  }

  .prompt-right {
    width: 100%;
    text-align: left;
    flex-shrink: unset;
  }
}
