:root {
  --paper: #f3efe6;
  --paper-deep: #e8e1d4;
  --ink: #1f2925;
  --muted: #77796f;
  --line: rgba(31, 41, 37, .16);
  --accent: #e76f51;
  --accent-soft: #f2b4a1;
  --green: #8a9b75;
  --blue: #5b7693;
  --white: #fffdf7;
  --shadow: 0 18px 55px rgba(48, 47, 37, .08);
  color: var(--ink);
  background: var(--paper);
  font-family: "Iowan Old Style", "Baskerville", "Songti SC", "STSong", serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 25px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand, .admin-brand { display: inline-flex; align-items: center; gap: 11px; font-family: "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: -.03em; }
.brand { font-size: 17px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--ink); border-radius: 50%; font-family: "Songti SC", serif; font-weight: 700; }
.site-nav { display: flex; gap: 28px; font: 12px/1 "Helvetica Neue", "PingFang SC", sans-serif; color: var(--muted); }
.site-nav a { position: relative; padding: 5px 0; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px; background: var(--ink); transition: right .25s ease; }
.site-nav a:hover::after, .site-nav a.is-active::after { right: 0; }

.home-shell { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }
.eyebrow { display: inline-block; margin-bottom: 19px; color: var(--accent); font: 700 10px/1.2 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .18em; text-transform: uppercase; }
.home-summary { padding: 42px 0 25px; color: var(--ink); font-size: 30px; line-height: 1.2; letter-spacing: -.04em; }
.feed-filter { max-width: 680px; margin: 0 0 46px; }
.feed-filter label { display: block; margin-bottom: 9px; color: var(--muted); font: 10px/1.2 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.feed-filter-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.feed-filter input, .feed-filter select { min-width: 160px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 999px; outline: 0; background: rgba(255, 253, 247, .55); color: var(--ink); font: 12px/1 "Helvetica Neue", "PingFang SC", sans-serif; }
.feed-filter input[type="search"] { min-width: 240px; }
.feed-filter input:focus, .feed-filter select:focus { border-color: var(--accent); }
.filter-reset { color: var(--muted); font: 11px/1 "Helvetica Neue", "PingFang SC", sans-serif; }
.filter-reset:hover { color: var(--accent); }
.post-stream { padding-bottom: 120px; }
.post-card { position: relative; display: grid; grid-template-columns: 70px minmax(0, 1fr) 178px; min-height: 270px; padding: 35px 0 35px; border-top: 1px solid var(--line); overflow: hidden; }
.post-card:last-child { border-bottom: 1px solid var(--line); }
.post-index { color: var(--accent); font: 12px/1 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .1em; }
.post-card-main { max-width: 650px; }
.post-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font: 10px/1.3 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .055em; text-transform: uppercase; }
.meta-dot { color: var(--accent); }
.post-card h2 { margin: 23px 0 14px; font-size: clamp(30px, 4vw, 54px); line-height: 1.02; letter-spacing: -.055em; font-weight: 400; }
.post-card h2 a { transition: color .2s ease; }
.post-card h2 a:hover { color: var(--accent); }
.post-card p { max-width: 530px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.read-link { display: inline-flex; gap: 9px; align-items: center; margin-top: 26px; color: var(--ink); font: 11px/1 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .08em; }
.read-link span { color: var(--accent); font-size: 15px; transition: transform .2s ease; }
.read-link:hover span { transform: translate(3px, -3px); }
.post-card-accent { align-self: center; justify-self: end; width: 135px; height: 135px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--ink); transform: rotate(-13deg); transition: transform .5s ease, background .3s ease; }
.post-card:nth-child(3n + 2) .post-card-accent { background: var(--green); transform: rotate(8deg); }
.post-card:nth-child(3n + 3) .post-card-accent { background: #d9c4a6; transform: rotate(17deg); }
.post-card:hover .post-card-accent { transform: rotate(0deg) scale(1.06); }
.post-card-accent span { font: 11px/1 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .1em; }

.article-shell { width: min(900px, calc(100% - 64px)); margin: 0 auto; padding: 62px 0 130px; }
.back-link { display: inline-block; color: var(--muted); font: 11px/1 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .05em; transition: color .2s ease; }
.back-link:hover { color: var(--accent); }
.article-header { padding: 105px 0 75px; border-bottom: 1px solid var(--line); }
.article-header h1 { max-width: 800px; margin: 18px 0 25px; font-size: clamp(48px, 8vw, 96px); line-height: .95; letter-spacing: -.07em; font-weight: 400; }
.article-summary { max-width: 590px; margin: 0; color: var(--muted); font-size: 19px; line-height: 1.75; }
.article-body { max-width: 690px; margin: 72px auto 0; font-size: 19px; line-height: 1.95; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4 { margin: 1.9em 0 .65em; line-height: 1.15; letter-spacing: -.04em; font-weight: 400; }
.article-body h1 { font-size: 42px; }
.article-body h2 { font-size: 34px; }
.article-body h3 { font-size: 28px; }
.article-body p { margin: 0 0 1.35em; }
.article-body a { text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 4px; }
.article-body strong { font-weight: 700; }
.article-body em { color: var(--accent); }
.article-body blockquote { margin: 2em 0; padding: 17px 25px; border-left: 3px solid var(--accent); color: #59645d; background: rgba(255, 253, 247, .55); font-size: 23px; line-height: 1.6; }
.article-body ul, .article-body ol { padding-left: 1.4em; margin: 1.3em 0; }
.article-body li { padding-left: .4em; margin-bottom: .45em; }
.article-body code { padding: .15em .35em; border-radius: 3px; background: var(--paper-deep); font: .78em/1.2 "SFMono-Regular", Consolas, monospace; }
.article-body pre { margin: 2em 0; padding: 22px 24px; overflow: auto; border-radius: 4px; background: #25312d; color: #e8e1d4; font: 14px/1.65 "SFMono-Regular", Consolas, monospace; }
.article-body pre code { padding: 0; background: none; color: inherit; }
.article-body .table-scroll { margin: 2em 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article-body table.article-table { width: 100%; min-width: 420px; border-collapse: collapse; font-size: .86em; line-height: 1.55; }
.article-body table.article-table th, .article-body table.article-table td { padding: .55em .7em; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-body table.article-table th { background: rgba(232, 225, 212, .55); font-weight: 700; }
.article-body hr { width: 30%; margin: 3.5em 0; border: 0; border-top: 1px solid var(--line); }
.article-image { margin: 2.3em -70px; }
.article-image img { display: block; width: 100%; max-height: 580px; object-fit: cover; }
.article-image figcaption, .article-image .article-caption { margin-top: 9px; color: var(--muted); font: 11px/1.4 "Helvetica Neue", sans-serif; }
.article-footer { max-width: 690px; margin: 75px auto 0; padding-top: 27px; border-top: 1px solid var(--line); }
.promo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 78px auto 0; }
.promo-grid + .article-body, .article-body + .promo-grid { margin-top: 42px; }
.promo-grid-single { grid-template-columns: minmax(0, 690px); justify-content: center; }
.promo-card { display: flex; justify-content: space-between; gap: 30px; align-items: center; margin: 0; padding: 30px 34px; border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow); }
.promo-copy { max-width: 480px; }
.promo-copy .eyebrow { margin-bottom: 13px; }
.promo-copy h2 { margin: 0 0 11px; font-size: 31px; line-height: 1.1; letter-spacing: -.04em; font-weight: 400; }
.promo-copy p { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.promo-copy strong { color: var(--accent); font: 700 12px/1.2 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .06em; }
.promo-qr { flex: 0 0 88px; width: 88px; height: 88px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); background: var(--paper-deep); }
.promo-qr img { display: block; width: 100%; height: 100%; object-fit: cover; }
.promo-seal { color: var(--accent); font: 700 12px/1.35 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .1em; text-align: center; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 999px; font: 12px/1 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .04em; transition: transform .2s ease, background .2s ease, color .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-dark { background: var(--ink); color: var(--paper); }
.button-dark:hover { background: var(--accent); }
.button-accent { background: var(--accent); color: #fffaf1; }
.button-danger { background: transparent; color: #b54f3d; }
.button-danger:hover { background: #f3d9d0; }
.button-light { border-color: var(--line); background: var(--white); color: var(--ink); }
.button-light:hover { background: var(--paper-deep); }
.button-ghost { background: transparent; color: var(--muted); }
.full-width { width: 100%; }
.empty-state, .not-found { padding: 130px 0; text-align: center; }
.empty-state h2, .not-found h1 { margin: 0 0 15px; font-size: 48px; line-height: 1; font-weight: 400; letter-spacing: -.05em; }
.empty-state p { margin: 0 0 28px; color: var(--muted); }

.admin-app { min-height: 100vh; display: grid; grid-template-columns: 290px minmax(0, 1fr); background: var(--paper); }
.admin-sidebar { display: flex; flex-direction: column; padding: 27px 23px; border-right: 1px solid var(--line); background: rgba(255, 253, 247, .4); }
.admin-brand { gap: 10px; margin-bottom: 31px; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font: 700 14px/1.2 "Helvetica Neue", "PingFang SC", sans-serif; }
.admin-brand small { margin-top: 4px; color: var(--muted); font: 10px/1.2 "Helvetica Neue", "PingFang SC", sans-serif; }
.admin-filter { margin-top: 24px; padding: 13px 0 15px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.admin-filter label { display: block; margin-bottom: 9px; color: var(--muted); font: 10px/1.2 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.admin-filter-row { display: flex; align-items: center; gap: 7px; }
.admin-filter input { min-width: 0; flex: 1; padding: 7px 8px; border: 1px solid var(--line); border-radius: 3px; outline: 0; background: var(--white); color: var(--ink); font: 12px/1.2 "Helvetica Neue", sans-serif; }
.admin-filter input:focus { border-color: var(--accent); }
.filter-clear { padding: 7px 5px; border: 0; background: transparent; color: var(--muted); font: 10px/1 "Helvetica Neue", sans-serif; }
.filter-clear:hover { color: var(--accent); }
.admin-list-heading { display: flex; justify-content: space-between; margin: 31px 3px 12px; color: var(--muted); font: 10px/1 "Helvetica Neue", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.admin-post-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.admin-post-item { display: block; width: 100%; padding: 12px 12px 14px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; }
.admin-post-item:hover, .admin-post-item.is-selected { background: var(--paper-deep); }
.admin-post-item strong, .admin-post-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-post-item strong { margin: 7px 0 8px; font-size: 16px; font-weight: 400; }
.admin-post-item small { color: var(--muted); font: 10px/1 "Helvetica Neue", sans-serif; }
.admin-item-status { font: 9px/1 "Helvetica Neue", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.admin-item-status.published { color: var(--accent); }
.admin-item-status.draft { color: var(--blue); }
.admin-list-empty { margin: 10px 3px; color: var(--muted); font-size: 14px; }
.sidebar-home { margin-top: auto; padding: 17px 3px 0; border-top: 1px solid var(--line); color: var(--muted); font: 11px/1 "Helvetica Neue", sans-serif; }
.admin-editor { display: flex; min-width: 0; flex-direction: column; padding: 28px clamp(24px, 4vw, 65px) 32px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; min-height: 30px; }
.admin-topbar .eyebrow { margin-bottom: 0; }
.admin-status { color: var(--muted); font: 11px/1 "Helvetica Neue", sans-serif; }
.admin-status.success { color: #608054; }
.admin-status.error { color: #bb4936; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 56px); min-height: 0; margin-top: 28px; flex: 1; }
.editor-pane, .preview-pane { min-width: 0; }
.editor-pane { padding: 15px 0; }
.editor-pane label { display: block; margin-bottom: 21px; color: var(--muted); font: 10px/1.2 "Helvetica Neue", "PingFang SC", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.editor-pane input, .editor-pane textarea { display: block; width: 100%; margin-top: 9px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; outline: none; background: transparent; color: var(--ink); }
.editor-pane input { padding: 9px 0 12px; font-size: 17px; }
.editor-pane textarea { padding: 11px 12px; border: 1px solid var(--line); background: rgba(255, 253, 247, .45); font-size: 15px; line-height: 1.65; resize: vertical; }
.editor-pane input:focus, .editor-pane textarea:focus { border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.body-label { display: flex !important; flex-direction: column; height: calc(100vh - 360px); min-height: 300px; }
.body-label textarea { flex: 1; min-height: 0; resize: none; font: 15px/1.75 "SFMono-Regular", Consolas, monospace; }
.preview-pane { padding: 16px 0 0 clamp(20px, 3vw, 44px); border-left: 1px solid var(--line); overflow: auto; }
.preview-label { margin-bottom: 32px; color: var(--accent); font: 10px/1 "Helvetica Neue", sans-serif; letter-spacing: .15em; text-transform: uppercase; }
.preview-body { margin: 0; max-width: 660px; font-size: 16px; }
.preview-body h1 { font-size: 35px; }
.preview-body h2 { font-size: 29px; }
.preview-body h3 { font-size: 24px; }
.preview-empty { padding: 55px 0; color: var(--muted); font-style: italic; }
.editor-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 22px; border-top: 1px solid var(--line); }
.admin-login { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(31, 41, 37, .34); backdrop-filter: blur(7px); }
.admin-login.is-hidden { display: none; }
.login-card { width: min(390px, 100%); padding: 39px; background: var(--paper); box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 12px; font-size: 42px; line-height: 1; font-weight: 400; letter-spacing: -.06em; }
.login-card p { margin: 0 0 25px; color: var(--muted); line-height: 1.5; }
.login-card input { width: 100%; margin-bottom: 12px; padding: 13px 0; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: transparent; }
.login-card input:focus { border-color: var(--accent); }
.login-card small { display: block; min-height: 15px; margin-top: 12px; color: #bb4936; font: 11px/1.3 "Helvetica Neue", sans-serif; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease var(--delay, 0ms), transform .7s ease var(--delay, 0ms); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .site-header, .home-shell, .article-shell { width: min(100% - 36px, 620px); }
  .site-header { padding: 19px 0; }
  .site-nav { gap: 17px; }
  .post-card { grid-template-columns: 39px minmax(0, 1fr); min-height: 0; padding: 27px 0 31px; }
  .post-card-accent { position: absolute; right: -38px; top: 51px; width: 102px; height: 102px; opacity: .6; }
  .post-card h2 { margin-top: 17px; font-size: 34px; padding-right: 35px; }
  .post-card p { font-size: 15px; padding-right: 20px; }
  .article-shell { padding-top: 40px; }
  .article-header { padding: 74px 0 48px; }
  .article-header h1 { font-size: clamp(46px, 14vw, 76px); }
  .article-summary { font-size: 17px; }
  .article-body { margin-top: 45px; font-size: 17px; line-height: 1.85; }
  .article-body h1 { font-size: 35px; }
  .article-body h2 { font-size: 30px; }
  .article-image { margin: 2em 0; }
  .promo-grid { display: block; margin-top: 55px; }
  .promo-grid .promo-card { display: block; margin: 0; padding: 25px; }
  .promo-grid .promo-card + .promo-card { margin-top: 18px; }
  .promo-qr { margin-top: 22px; }
  .admin-app { display: block; }
  .admin-sidebar { min-height: auto; padding: 20px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-brand { margin-bottom: 19px; }
  .admin-list-heading { margin-top: 22px; }
  .admin-post-list { max-height: 180px; }
  .sidebar-home { margin-top: 20px; }
  .admin-editor { padding: 20px 18px 27px; }
  .editor-layout { display: block; }
  .preview-pane { margin-top: 28px; padding: 27px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .body-label { height: 330px; }
  .form-row { display: block; }
  .editor-actions { position: sticky; bottom: 0; margin: 0 -18px; padding: 15px 18px; background: rgba(243, 239, 230, .95); }
}
