:root {
  --paper: #efe7d4;
  --page: #fbf6e9;
  --ink: #2b2420;
  --muted: #7a6e58;
  --red: #a23b2e;
  --rule2: #ddd0af;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Lora', serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 460px at 85% -10%, rgba(162,59,46,0.05), transparent 60%),
    var(--paper);
  display: flex;
  justify-content: center;
  padding: 54px 20px;
}

.wrap { width: 100%; max-width: 700px; }

header { margin-bottom: 24px; }
.tag {
  font-family: 'Courier Prime', monospace;
  color: var(--red);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  text-transform: uppercase;
}
h1 { font-size: 32px; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; }
.desc { font-size: 14px; color: var(--muted); line-height: 1.7; margin: 0; max-width: 560px; }
.desc code {
  font-family: 'Courier Prime', monospace;
  background: rgba(162,59,46,0.08);
  padding: 1px 5px;
  color: var(--red);
  font-size: 12.5px;
}

.card {
  background: var(--page);
  border: 1px solid var(--rule2);
  border-top: 3px solid var(--red);
  padding: 22px;
  box-shadow: 0 20px 40px -26px rgba(43,36,32,0.3);
}
.card + .card { margin-top: 16px; }

#title {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px dashed var(--rule2);
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 17px;
  padding: 4px 2px 10px;
  margin-bottom: 16px;
  color: var(--ink);
}
#title:focus { outline: none; border-color: var(--red); }

label {
  display: block;
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 620px) { .split { grid-template-columns: 1fr; } }

.pane textarea {
  width: 100%;
  background: #f3ecd9;
  border: 1px solid var(--rule2);
  border-left: 3px solid var(--red);
  font-family: 'Courier Prime', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  padding: 12px 14px;
  resize: vertical;
}
.pane textarea:focus { outline: none; }

.preview {
  background: var(--page);
  border: 1px solid var(--rule2);
  padding: 14px 18px;
  min-height: 220px;
  font-size: 14.5px;
  line-height: 1.75;
  font-family: 'Lora', serif;
}
.preview h1, .preview h2, .preview h3 { font-weight: 600; margin-top: 0; }
.preview p:first-of-type::first-letter {
  font-size: 2.6em;
  font-weight: 600;
  float: left;
  line-height: 0.8;
  padding: 6px 6px 0 0;
  color: var(--red);
}
.preview blockquote { border-left: 3px solid var(--red); margin: 10px 0; padding-left: 14px; color: var(--muted); font-style: italic; }
.preview code { font-family: 'Courier Prime', monospace; background: rgba(162,59,46,0.08); padding: 1px 5px; font-size: 12.5px; }
.preview pre { background: #efe6d2; padding: 10px; overflow-x: auto; border: 1px solid var(--rule2); }
.preview a { color: var(--red); }
.preview ul { padding-left: 20px; }

button {
  margin-top: 16px;
  background: var(--ink);
  color: var(--page);
  border: none;
  font-family: 'Courier Prime', monospace;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  padding: 11px 18px;
  cursor: pointer;
  text-transform: uppercase;
}
button:hover { background: var(--red); }

footer { margin-top: 26px; text-align: center; }
footer a { color: var(--muted); font-size: 12px; text-decoration: none; font-family: 'Courier Prime', monospace; }
footer a:hover { color: var(--red); }
