@font-face {
  font-family: "Jost";
  src: url("/fonts/jost.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #231f21;
  --ink-soft: #7a6e73;
  --petal: #f2b8c6;
  --petal-deep: #c98da0;
  --accent: #a04b62;
  --rule: #f0e4e8;        /* hairlines tinted toward the petal */
  --code-bg: #f8f4f5;
  --geo: "Jost", "Avenir Next", "Century Gothic", Futura, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
body.datasheet {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--geo);
  line-height: 1.65;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.ds-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(16px, 4vw, 40px);
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.ds-head a { color: var(--ink); text-decoration: none; }
.ds-head a:hover { color: var(--accent); }
.ds-doc { color: var(--ink-soft); }
.ds-doc a { text-decoration: underline; text-decoration-color: var(--petal); text-underline-offset: 3px; }

.ds-body {
  width: 100%;
  max-width: 68ch;
  margin: 0 auto;
  padding: clamp(32px, 6vh, 64px) clamp(18px, 4vw, 32px) 64px;
  flex: 1;
}
.ds-body h1 {
  font-weight: 500;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin: 0 0 4px;
}
.ds-sub, .ds-meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  margin: 8px 0 32px;
}
.ds-body h2, .ds-body h3 {
  font-weight: 500;
  letter-spacing: 0.03em;
  margin: 1.8em 0 0.5em;
}
.ds-body h2 { font-size: 1.3rem; }
.ds-body a { color: var(--accent); text-decoration-color: var(--petal); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.ds-body a:hover { text-decoration-color: var(--accent); }
.ds-body pre {
  background: var(--code-bg);
  color: var(--ink);
  font-family: var(--mono);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  border-radius: 2px;
}
.ds-body code { font-family: var(--mono); font-size: 0.9em; }
.ds-body :not(pre) > code {
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 2px;
}
.ds-body img { max-width: 100%; }
.ds-body blockquote {
  margin: 1.4em 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--petal);
  color: var(--ink-soft);
}
.ds-body hr { border: none; border-top: 1px solid var(--rule); margin: 2em 0; }

.ds-list { list-style: none; padding: 0; margin: 0; }
.ds-list li {
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.ds-list a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
}
.ds-list a:hover { color: var(--accent); }
.ds-date { color: var(--ink-soft); font-size: 0.82rem; letter-spacing: 0.04em; white-space: nowrap; }
.ds-empty { color: var(--ink-soft); }

.ds-foot {
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  display: flex;
  gap: 24px;
  justify-content: center;
  padding: 18px;
  border-top: 1px solid var(--rule);
}
.ds-foot a { color: var(--accent); text-decoration: none; }
.ds-foot a:hover { text-decoration: underline; text-decoration-color: var(--petal); }

:focus-visible { outline: 2px solid var(--petal-deep); outline-offset: 3px; }

/* ---- admin editor ---- */
.ds-admin { max-width: 900px; }
.ds-admin .row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ds-admin input[type="text"] {
  flex: 1;
  min-width: 200px;
  font-family: var(--geo);
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}
.ds-admin textarea {
  width: 100%;
  min-height: 46vh;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 14px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}
.ds-admin button {
  font-family: var(--geo);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.ds-admin button:hover { background: var(--accent); border-color: var(--accent); }
.ds-admin button.ghost { background: transparent; color: var(--ink); }
.ds-admin button.ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }
.ds-admin button.danger { background: transparent; color: #a33; border-color: #a33; }
.ds-admin label.check { font-size: 0.85rem; display: inline-flex; align-items: center; gap: 8px; }
.ds-admin .postlist { margin: 0 0 24px; }
.ds-admin .postlist button { padding: 4px 10px; font-size: 0.8rem; }
.ds-admin .status { font-size: 0.85rem; color: var(--ink-soft); min-height: 1.4em; }
.ds-admin .status.err { color: #a33; }
#signin-view { text-align: center; padding: 60px 0; }
#editor-view[hidden] { display: none; }
