:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --text: #171714;
  --muted: #72726b;
  --line: #e5e4de;
  --line-strong: #d3d2ca;
  --accent: #191917;
  --accent-hover: #3a3a35;
  --danger: #b42318;
  --danger-soft: #fff1ef;
  --success: #207a52;
  --success-soft: #eaf7f0;
  --shadow: 0 20px 60px rgba(28, 28, 24, 0.07);
  --shadow-soft: 0 8px 30px rgba(28, 28, 24, 0.05);
  --radius: 18px;
  --radius-sm: 11px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(circle at 20% 0%, rgba(255,255,255,.95), transparent 32rem),
  var(--bg); }
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
::selection { background: #dcdcd3; }

.container { width: min(1040px, calc(100% - 40px)); margin-inline: auto; }
.reading-container { width: min(760px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(211, 210, 202, .72);
  background: rgba(246, 246, 243, .8);
  backdrop-filter: blur(18px);
}
.site-header .container {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .92rem;
  font-weight: 750;
  letter-spacing: -.02em;
}
.brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 5px rgba(23, 23, 20, .08);
}
.header-link {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 650;
  transition: color .18s ease;
}
.header-link:hover { color: var(--text); }

main { padding: 70px 0 100px; }
.hero { margin-bottom: 54px; max-width: 700px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.055em;
}
.hero p {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.post-list { border-top: 1px solid var(--line-strong); }
.post-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 28px 4px;
  border-bottom: 1px solid var(--line);
  transition: padding .2s ease, opacity .2s ease;
}
.post-item:hover { padding-left: 12px; padding-right: 12px; }
.post-item h2 {
  margin: 0 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -.025em;
}
.post-item .arrow {
  align-self: center;
  color: var(--muted);
  font-size: 1.3rem;
  transition: transform .2s ease, color .2s ease;
}
.post-item:hover .arrow { transform: translateX(5px); color: var(--text); }
.meta { margin: 0; color: var(--muted); font-size: .78rem; letter-spacing: .015em; }

.article-shell {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: clamp(32px, 7vw, 74px);
}
.article-header { margin-bottom: 48px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.article-header h1 {
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.045em;
}
.back-link { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 30px; color: var(--muted); font-size: .86rem; font-weight: 650; }
.back-link:hover { color: var(--text); }

.post-body { color: #292925; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.post-body > *:first-child { margin-top: 0; }
.post-body > *:last-child { margin-bottom: 0; }
.post-body h1, .post-body h2, .post-body h3 {
  margin: 2.2em 0 .7em;
  color: var(--text);
  font-family: Inter, ui-sans-serif, sans-serif;
  line-height: 1.22;
  letter-spacing: -.03em;
}
.post-body h1 { font-size: 2rem; }
.post-body h2 { font-size: 1.55rem; }
.post-body h3 { font-size: 1.2rem; }
.post-body p, .post-body ul, .post-body ol { margin: 1.15em 0; }
.post-body a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.post-body img { max-width: 100%; border-radius: var(--radius-sm); }
.post-body hr { margin: 3em 0; border: 0; border-top: 1px solid var(--line); }
.post-body blockquote {
  margin: 2em 0;
  padding: 2px 0 2px 24px;
  border-left: 2px solid var(--text);
  color: #5d5d56;
  font-style: italic;
}
.post-body code {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f1f1ed;
  padding: .1em .35em;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .86em;
}
.post-body pre {
  overflow: auto;
  margin: 1.8em 0;
  border-radius: 14px;
  background: #1d1d1a;
  color: #ecece5;
  padding: 22px 24px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.post-body pre code { border: 0; background: transparent; padding: 0; color: inherit; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 28px;
}
.empty {
  margin: 0;
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.notice { margin: 0 0 18px; border: 1px solid #f2c9c4; border-radius: var(--radius-sm); background: var(--danger-soft); color: #8f1d14; padding: 12px 15px; font-size: .9rem; }

button, .button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 9px 18px;
  font-size: .86rem;
  font-weight: 720;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
button:hover, .button:hover { transform: translateY(-1px); background: var(--accent-hover); border-color: var(--accent-hover); }
button:active, .button:active { transform: translateY(0); }
button.ghost, .button.ghost { border-color: var(--line-strong); background: transparent; color: var(--text); }
button.ghost:hover, .button.ghost:hover { background: #ecece7; border-color: #c4c3bb; }
button.danger { border-color: transparent; background: transparent; color: var(--danger); padding-inline: 11px; }
button.danger:hover { background: var(--danger-soft); }

input, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: rgba(255,255,255,.9);
  color: var(--text);
  padding: 12px 14px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:focus, textarea:focus { border-color: #85857d; background: white; box-shadow: 0 0 0 4px rgba(30,30,27,.07); }
textarea { min-height: 470px; resize: vertical; font-family: "SFMono-Regular", Consolas, monospace; font-size: .9rem; line-height: 1.65; }
.field { margin-bottom: 22px; }
.field > label { display: block; margin-bottom: 8px; font-size: .82rem; font-weight: 720; }
.field-hint { margin: 7px 0 0; color: var(--muted); font-size: .78rem; }
.checkbox-label { display: inline-flex !important; align-items: center; gap: 9px; margin: 0 !important; cursor: pointer; }
.checkbox-label input { width: 17px; height: 17px; accent-color: var(--text); }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.admin-heading { margin-bottom: 28px; }
.admin-heading h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.045em; line-height: 1; }
.admin-heading p { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 0 12px 12px; color: var(--muted); font-size: .69rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 750; }
.admin-table td { padding: 17px 12px; border-top: 1px solid var(--line); vertical-align: middle; font-size: .88rem; }
.admin-table td:first-child { font-weight: 680; }
.admin-table .slug { color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: .78rem; }
.admin-table .actions { justify-content: flex-end; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: #ecece7; color: #60605a; padding: 5px 10px; font-size: .72rem; font-weight: 720; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #999991; }
.status.live { background: var(--success-soft); color: var(--success); }
.status.live::before { background: var(--success); }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.preview { min-height: 470px; max-height: 70vh; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: white; padding: 24px; }
.editor-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 6px; }
.login-card { max-width: 430px; margin: 8vh auto 0; padding: 38px; }
.login-mark { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 28px; border-radius: 14px; background: var(--text); color: white; font-family: Georgia, serif; font-size: 1.3rem; }
.login-card h1 { margin: 0 0 9px; font-size: 1.8rem; letter-spacing: -.04em; }
.login-card .intro { margin: 0 0 28px; color: var(--muted); font-size: .9rem; }

@media (max-width: 780px) {
  .container, .reading-container { width: min(100% - 28px, 1040px); }
  main { padding: 46px 0 70px; }
  .site-header .container { min-height: 62px; }
  .hero { margin-bottom: 38px; }
  .post-item { grid-template-columns: 1fr auto; padding-block: 22px; }
  .article-shell { border-radius: 18px; padding: 30px 22px; }
  .editor-grid { grid-template-columns: 1fr; }
  .preview { max-height: none; }
  .admin-table th:nth-child(2), .admin-table td:nth-child(2) { display: none; }
  .admin-table th, .admin-table td { padding-inline: 7px; }
  .admin-table .actions { gap: 2px; }
  .card { padding: 20px; }
}

@media (max-width: 520px) {
  .header-link { font-size: .8rem; }
  .post-item .arrow { display: none; }
  .admin-table th:nth-child(3), .admin-table td:nth-child(3) { display: none; }
  .editor-actions { align-items: stretch; flex-direction: column-reverse; }
  .editor-actions button { width: 100%; }
  .login-card { margin-top: 3vh; padding: 28px 22px; }
}
