:root {
  color-scheme: light dark;
  --bg: #faf9f6;
  --ink: #2a2622;
  --muted: #8a8378;
  --accent: #c9622f;
  --line: #e6e1d8;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "iA Writer Quattro", "Iowan Old Style", ui-serif, Georgia, serif;
}

main {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 3rem 1.5rem 4rem;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--accent);
}

.status {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  transition: opacity 0.2s ease;
}

#entry-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

#name {
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
}

#name:focus {
  border-bottom-color: var(--accent);
}

#content {
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1.6;
  min-height: 5rem;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

button[type="submit"] {
  align-self: flex-end;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

button[type="submit"]:hover {
  background: var(--accent);
  color: var(--bg);
}

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.entry {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.entry:last-child {
  border-bottom: none;
}

.entry-meta {
  font-size: 0.78rem;
  font-family: ui-monospace, monospace;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.entry-content {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a17;
    --ink: #ece7de;
    --muted: #8a8378;
    --accent: #e08a52;
    --line: #33302b;
  }
}
