/* ------------------------------------------------------------------ *
 *  The blog. Cream, open, no boxes — one plain font, works on any screen.
 * ------------------------------------------------------------------ */

:root {
  --bg: #faf8f3;
  --ink: #1c1a17;
  --muted: #6f6a61;
  --faint: #9a948a;
  --line: #e7e1d6;
  --line-2: #cdc5b6;
  --accent: #1c1a17;
  --danger: #a3271d;
  --ok: #1c6b3a;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color-scheme: light; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 26px 120px; }

/* ------------------------------ top bar ------------------------------ */
.topbar {
  display: flex; align-items: baseline; gap: 18px;
  padding: 78px 0 16px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.topbar .right { display: flex; gap: 20px; align-items: baseline; flex-wrap: wrap; }
.topbar .right a {
  font-size: 13.5px; color: var(--muted); text-decoration: none;
  border-bottom: 1px solid transparent; padding-bottom: 2px;
}
.topbar .right a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.topbar .right a.on { color: var(--ink); border-bottom-color: var(--ink); }

/* ------------------------------ headings ------------------------------ */
h1.page {
  font-size: 42px; font-weight: 700; letter-spacing: -1.1px; line-height: 1.1;
  margin-top: 40px;
}
.lede { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 560px; margin-top: 12px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 32px 0 0; }

/* ------------------------------- search ------------------------------- */
.search { position: relative; margin: 26px 0 4px; max-width: 520px; }
.search svg {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; fill: var(--faint); pointer-events: none;
}
.search input[type="search"] {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 12px 0 12px 34px; outline: none;
  transition: border-color .18s ease;
  -webkit-appearance: none; appearance: none;
}
.search input[type="search"]::placeholder { color: var(--faint); }
.search input[type="search"]:focus { border-bottom-color: var(--ink); }

/* -------------------------------- list -------------------------------- */
.list { margin-top: 4px; }
.entry { padding: 30px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }

.entry .meta { margin-top: 0; }
.entry h2 { font-size: 23px; font-weight: 650; letter-spacing: -.4px; line-height: 1.28; margin-top: 12px; }
.entry h2 a { color: var(--ink); text-decoration: none; }
.entry h2 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.meta {
  font-size: 12.5px; color: var(--faint); margin-top: 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.meta .av {
  width: 22px; height: 22px; border-radius: 7px; overflow: hidden; flex: none;
  border: 1px solid var(--line); background: var(--tile);
}
.meta .av svg { width: 100%; height: 100%; display: block; }
.meta b { font-weight: 600; color: var(--muted); }
.meta .dot { color: var(--line-2); }

.excerpt { font-size: 16px; line-height: 1.65; color: var(--excerpt); margin-top: 10px; max-width: 660px; }

/* ---------------------------- a single post ---------------------------- */
.post-head { margin-top: 36px; }
.post-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -.9px; line-height: 1.18; max-width: 780px; }
.post-head .meta { margin-top: 16px; }

.post-body {
  font-size: 17px; line-height: 1.75; color: var(--body);
  white-space: pre-wrap; overflow-wrap: break-word;
  max-width: 680px; margin-top: 30px;
}

.back {
  display: inline-block; margin-top: 34px; font-size: 13.5px; color: var(--muted);
  text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 2px;
}
.back:hover { color: var(--ink); border-bottom-color: var(--line-2); }

.more { margin-top: 64px; border-top: 1px solid var(--line); padding-top: 26px; }
.more h3 {
  font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.more ul { list-style: none; margin-top: 14px; }
.more li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.more li:last-child { border-bottom: 0; }
.more li a { font-size: 17px; font-weight: 600; color: var(--ink); text-decoration: none; }
.more li a:hover { text-decoration: underline; text-underline-offset: 4px; }
.more li span { display: block; font-size: 12.5px; color: var(--faint); margin-top: 5px; }

/* ------------------------------- forms ------------------------------- */
.field { margin-bottom: 26px; }
label {
  display: block; font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px; font-weight: 600;
}
.count { float: right; text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 12px; font-weight: 400; }
.count.warn { color: var(--warn); }

input[type="text"], input[type="search"], textarea, select {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 12px 0; outline: none;
  transition: border-color .18s ease;
  -webkit-appearance: none; appearance: none; border-radius: 0;
}
input[type="text"]:focus, textarea:focus, select:focus { border-bottom-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input.bad, textarea.bad { border-bottom-color: var(--danger); }
textarea {
  font-size: 16px; line-height: 1.7; min-height: 260px; resize: vertical;
  border: 1px solid var(--line); border-radius: 4px; padding: 16px; background: var(--field-2);
}
textarea:focus { border-color: var(--line-2); }
select {
  cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6a61' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 4px center; background-size: 16px;
}

/* ------------------------------ buttons ------------------------------ */
button.primary, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; cursor: pointer;
  color: var(--bg); background: var(--accent); border: 1px solid var(--accent);
  padding: 14px 28px; border-radius: 999px; text-decoration: none;
  transition: opacity .15s ease;
}
button.primary:hover:not(:disabled), a.btn:hover { opacity: .82; }
button.primary:disabled { opacity: .45; cursor: default; }
button.primary.wide { width: 100%; }

button.ghost {
  font-family: var(--sans); font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--muted); background: transparent; border: 1px solid var(--line-2);
  padding: 13px 22px; border-radius: 999px;
  transition: color .15s ease, border-color .15s ease;
}
button.ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--ink); }
button.ghost:disabled { opacity: .45; cursor: default; }

button.mini {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; cursor: pointer;
  color: var(--muted); background: transparent; border: 1px solid var(--line-2);
  padding: 7px 14px; border-radius: 999px;
  transition: color .15s ease, border-color .15s ease;
}
button.mini:hover:not(:disabled) { color: var(--ink); border-color: var(--ink); }
button.mini.danger { color: var(--danger); border-color: var(--danger-line); }
button.mini.danger:hover:not(:disabled) { color: #fff; background: var(--danger); border-color: var(--danger); }

.spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--spin-track); border-top-color: var(--bg);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------ messages ------------------------------ */
.msg { margin-top: 20px; font-size: 14.5px; line-height: 1.6; display: none; padding: 13px 16px; border-radius: 6px; }
.msg.on { display: block; }
.msg.err { background: var(--err-bg); color: var(--danger); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.busy { background: var(--busy-bg); color: var(--muted); display: flex; align-items: center; gap: 10px; }
.msg.busy .spin { border-color: var(--spin-track); border-top-color: var(--ink); }

/* ------------------------------- misc ------------------------------- */
.empty { font-size: 16px; color: var(--muted); line-height: 1.65; padding: 8px 0; }
.note { font-size: 13.5px; color: var(--faint); margin-top: 18px; line-height: 1.7; max-width: 560px; }
.loading { font-size: 15px; color: var(--faint); margin-top: 26px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--muted); }

.section-label {
  font-size: 11.5px; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}

.turned { margin-top: 10px; }
.turned .item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.turned .item:last-child { border-bottom: 0; }
.turned .item b { font-size: 17px; font-weight: 650; display: block; }
.turned .why { font-size: 13.5px; color: var(--danger); margin-top: 6px; }
.turned .when { font-size: 12.5px; color: var(--faint); margin-top: 5px; }

/* a post you wrote, with its own buttons */
.mine-actions { display: flex; gap: 8px; margin-top: 14px; }

/* language picker + translate button */
.langrow { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.langrow .pick { flex: 1; min-width: 200px; }

/* ------------------------------ narrow ------------------------------ */
@media (max-width: 620px) {
  .wrap { padding: 0 20px 100px; }
  .topbar { padding-top: 74px; flex-direction: column; align-items: flex-start; gap: 14px; }
  .topbar .right { gap: 16px; }
  .topbar .right a { font-size: 13px; }
  h1.page { font-size: 31px; margin-top: 30px; }
  .lede { font-size: 15.5px; }
  .entry { padding: 26px 0; }
  .entry h2 { font-size: 20px; }
  .excerpt { font-size: 15px; }
  .post-head h1 { font-size: 26px; }
  .post-body { font-size: 16px; }
  textarea { min-height: 200px; }
  button.primary, a.btn { width: 100%; }
  button.primary.wide { width: 100%; }
  .more li a { font-size: 16px; }
  .langrow { flex-direction: column; align-items: stretch; }
  .langrow .pick { min-width: 0; }
}
