@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Literata:opsz,wght@7..72,400;7..72,500;7..72,600&display=swap');

:root {
  --paper: #f5f0e6;
  --paper-deep: #eae2d3;
  --ink: #26231f;
  --muted: #777368;
  --copper: #9a5539;
  --olive: #6e7563;
  --line: #d9d1c2;
  --white: #fffdf8;
  --serif: 'Literata', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --reader-scale: 1;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
a { color: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
#app { min-height: 100vh; display: flex; flex-direction: column; }
.site-header { padding: 0 5.8vw; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 32px; max-width: 1440px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand-mark { position: relative; width: 28px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
.brand-mark i { width: 11px; height: 21px; border: 1.5px solid var(--copper); display: block; transform: skewY(-9deg); }
.brand-mark i + i { margin-left: -1px; transform: skewY(9deg); border-left: 0; }
.brand-name { font-size: 13px; letter-spacing: .13em; font-weight: 600; line-height: 1.1; }
.brand-name b { font-weight: 700; color: var(--copper); }
.brand-name small { display: block; font-size: 8px; letter-spacing: .16em; color: var(--muted); font-weight: 500; margin-top: 6px; }
.main-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 46px); }
.main-nav a { text-decoration: none; color: #625e55; font-size: 12px; }
.main-nav a:hover, .main-nav a.active { color: var(--copper); }
.header-side { display: flex; align-items: center; gap: 20px; }
.header-note { color: var(--muted); letter-spacing: .14em; font-size: 8px; white-space: nowrap; }
.button { border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 16px; padding: 13px 18px; text-decoration: none; cursor: pointer; font-size: 11px; letter-spacing: .03em; transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-solid { color: var(--white); background: var(--ink); }
.button-solid:hover { background: var(--copper); }
.button-outline { border-color: var(--line); background: transparent; color: var(--ink); }
.button-outline:hover { border-color: var(--copper); color: var(--copper); }
.button-small { padding: 10px 13px; font-size: 10px; }
.button-danger { padding: 10px 13px; border-color: #b78372; color: #8d3b2b; background: transparent; }
.button-danger:hover { background: #f0dfd8; }
.page-main { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 5.8vw; flex: 1; }
.hero { min-height: 480px; padding: 76px 0 68px; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(260px, .88fr); align-items: center; gap: 7vw; }
.hero-left { max-width: 640px; }
.eyebrow-tag { display: inline-block; color: var(--copper); font-size: 9px; font-weight: 600; letter-spacing: .18em; line-height: 1.5; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { font: 400 clamp(43px, 5.2vw, 72px)/1.08 var(--serif); letter-spacing: -.04em; max-width: 670px; margin: 22px 0 20px; }
.hero-intro { max-width: 510px; font: 400 15px/1.8 var(--serif); color: #696459; }
.hero-actions { margin-top: 32px; display: flex; align-items: center; gap: 22px; }
.hero-caption { color: var(--muted); font-size: 8px; letter-spacing: .14em; }
.hero-art { display: block; width: 100%; height: auto; aspect-ratio: 1.4 / 1; object-fit: cover; object-position: center; border: 1px solid rgba(38,35,31,.12); background: var(--olive); }
.section-divider { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); min-height: 52px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 8px; letter-spacing: .17em; }
.library-section { padding: 66px 0 95px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 36px; }
.section-heading h2 { font: 400 clamp(30px, 3.7vw, 47px)/1.15 var(--serif); margin: 10px 0 0; letter-spacing: -.025em; }
.section-subtitle { max-width: 270px; color: var(--muted); font: 400 13px/1.7 var(--serif); margin: 0 0 4px; }
.catalog-controls { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 0; margin-bottom: 29px; }
.filter-group { display: flex; gap: 7px; }
.filter-button { border: 0; background: transparent; padding: 8px 12px; color: var(--muted); font-size: 10px; cursor: pointer; }
.filter-button:hover, .filter-button.active { color: var(--copper); background: #ebe2d5; }
.search-box { display: flex; align-items: center; gap: 8px; color: var(--muted); border-bottom: 1px solid #bcb4a6; padding: 2px 1px 7px; width: min(250px, 44vw); }
.search-box span { font: 400 22px var(--serif); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-box input::placeholder { color: #918b80; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.work-card { min-width: 0; border-top: 1px solid var(--line); padding-top: 12px; }
.work-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.work-card-top .eyebrow-tag { font-size: 8px; }
.work-index { color: #9a9589; font: 11px var(--serif); }
.work-cover { min-height: 236px; margin-bottom: 19px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; text-decoration: none; color: var(--paper); background: var(--ink); }
.work-card-1 .work-cover { background: var(--copper); }
.work-card-2 .work-cover { background: var(--olive); }
.work-cover::before { content: ''; position: absolute; width: 170px; height: 170px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; right: -32px; top: 23px; }
.work-cover::after { content: ''; position: absolute; width: 120px; height: 120px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; right: 12px; top: 48px; }
.cover-motif { position: absolute; top: 50%; right: 34px; transform: translateY(-50%); font-size: 66px; opacity: .55; }
.cover-copy { position: relative; z-index: 1; display: grid; gap: 12px; max-width: 76%; }
.cover-author { font: 500 8px var(--sans); letter-spacing: .17em; }
.cover-title { font: 400 clamp(22px, 2.2vw, 29px)/1.13 var(--serif); }
.cover-bottom { position: relative; z-index: 1; font-size: 7px; letter-spacing: .16em; opacity: .78; }
.work-meta { color: var(--copper); font-size: 8px; font-weight: 600; letter-spacing: .15em; margin-bottom: 10px; }
.work-title { font: 400 22px/1.25 var(--serif); margin-bottom: 8px; }
.work-description { color: #716c61; font: 400 12px/1.7 var(--serif); min-height: 41px; margin-bottom: 16px; }
.text-link { display: inline-flex; gap: 8px; color: var(--copper); font-size: 10px; letter-spacing: .04em; text-decoration: none; border-bottom: 1px solid #cfaa99; padding-bottom: 4px; }
.text-link:hover { color: var(--ink); border-color: var(--ink); }
.empty-library { max-width: 590px; margin: 42px auto; padding: 38px 30px; text-align: center; border: 1px solid var(--line); background: rgba(255,253,248,.36); }
.empty-library[hidden] { display: none; }
.empty-mark { color: var(--copper); font-size: 24px; }
.empty-library h3 { font: 400 24px/1.25 var(--serif); margin: 14px 0 9px; }
.empty-library p { color: var(--muted); font-size: 12px; line-height: 1.7; margin-bottom: 17px; }
.result-count { text-align: right; min-height: 14px; color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.inline-error { color: #933d2f; font-size: 12px; line-height: 1.6; }
.site-footer { width: 100%; max-width: 1440px; padding: 22px 5.8vw 28px; margin: 0 auto; }
.footer-rule { border-top: 1px solid var(--ink); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 15px; color: var(--muted); font-size: 9px; }
.footer-row a { color: var(--muted); text-decoration: none; }
.footer-row a:hover { color: var(--copper); }
.footer-mark { letter-spacing: .13em; font-size: 8px; }
/* Access and author workspace */
.admin-main { padding-top: 54px; padding-bottom: 65px; }
.login-panel { max-width: 590px; padding: clamp(28px, 6vw, 62px); border: 1px solid var(--line); background: rgba(255,253,248,.55); margin: 24px auto 55px; }
.login-panel h1, .admin-intro h1 { font: 400 clamp(36px, 4.4vw, 54px)/1.13 var(--serif); letter-spacing: -.03em; margin: 14px 0 15px; }
.login-copy { max-width: 440px; color: var(--muted); font: 400 14px/1.8 var(--serif); }
.login-button { margin-top: 13px; }
.login-footnote { margin: 24px 0 0; color: var(--muted); font-size: 9px; line-height: 1.7; letter-spacing: .04em; }
.admin-intro { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.admin-intro h1 { max-width: 630px; margin-bottom: 9px; }
.admin-intro p { color: var(--muted); font: 400 13px/1.7 var(--serif); margin: 0; }
.editor-workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; padding-top: 35px; }
.works-sidebar { border-right: 1px solid var(--line); padding-right: 22px; }
.sidebar-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; color: var(--muted); font-size: 9px; letter-spacing: .15em; }
.sidebar-count { color: var(--copper); font: 12px var(--serif); }
.admin-work-list { margin-top: 16px; display: grid; }
.admin-work-item { text-align: left; width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 13px 8px 13px 0; cursor: pointer; display: grid; gap: 6px; }
.admin-work-item:hover, .admin-work-item.selected { background: #ece5d8; padding-left: 9px; }
.admin-work-title { font: 400 14px/1.35 var(--serif); }
.admin-work-meta { color: var(--muted); font-size: 8px; letter-spacing: .12em; }
.sidebar-empty { color: var(--muted); font: 12px/1.7 var(--serif); }
.work-form-panel { min-width: 0; }
.work-form { display: grid; gap: 20px; }
.form-topline { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.form-heading { font: 400 24px var(--serif); }
.save-message { color: var(--olive); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 150px 160px; gap: 14px; }
.field-label { display: grid; gap: 7px; color: #6c675d; font-size: 9px; letter-spacing: .08em; }
.field-label input, .field-label select, .field-label textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; padding: 11px 12px; color: var(--ink); background: var(--white); font-size: 12px; letter-spacing: 0; }
.field-label textarea { resize: vertical; line-height: 1.65; }
.field-label input::placeholder, .field-label textarea::placeholder { color: #aaa395; }
.import-panel { display: grid; gap: 9px; padding: 14px 15px; background: #eee7da; }
.import-panel .field-label input { padding: 9px; font-size: 11px; }
.import-message { color: var(--muted); font-size: 10px; line-height: 1.6; }
.chapter-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-top: 4px; border-top: 1px solid var(--line); }
.chapter-section-heading h2 { font: 400 22px var(--serif); margin: 15px 0 4px; }
.chapter-section-heading p { color: var(--muted); font-size: 10px; margin: 0 0 14px; }
.chapters-holder { display: grid; gap: 14px; }
.chapter-editor { border: 1px solid var(--line); margin: 0; padding: 15px; display: grid; gap: 12px; min-width: 0; }
.chapter-editor-head { display: flex; align-items: center; justify-content: space-between; }
.chapter-number { color: var(--copper); font-size: 8px; letter-spacing: .14em; }
.quiet-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; padding: 5px; }
.quiet-button:hover { color: #9b3d2c; }
.chapter-content-input { min-height: 190px; }
.form-bottom { display: flex; justify-content: space-between; align-items: end; gap: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.form-bottom .field-label { width: min(100%, 340px); }
.form-actions { display: flex; align-items: center; gap: 10px; }
/* Reading view */
.reader-main { max-width: 980px; padding-top: 20px; }
.reader-toolbar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 13px; }
.reader-controls { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 8px; letter-spacing: .12em; }
.reader-control { border: 1px solid var(--line); background: transparent; padding: 5px 8px; cursor: pointer; font: 12px var(--serif); }
.reader-control:hover { border-color: var(--copper); color: var(--copper); }
.reading-progress { height: 2px; background: var(--line); position: sticky; top: 0; z-index: 5; }
.reading-progress-bar { height: 100%; width: 0; display: block; background: var(--copper); transition: width .15s linear; }
.reader-article { max-width: 710px; padding: 48px 0 75px; margin: 0 auto; }
.reader-heading { padding: 0 0 30px; border-bottom: 1px solid var(--line); }
.reader-heading h1 { font: 400 clamp(40px, 6vw, 66px)/1.12 var(--serif); letter-spacing: -.04em; margin: 15px 0 12px; }
.reader-description { color: var(--muted); font: 400 16px/1.7 var(--serif); max-width: 610px; }
.reader-byline { color: var(--copper); font: 600 8px var(--sans); letter-spacing: .18em; margin: 22px 0 0; }
.table-of-contents { margin: 26px 0 45px; padding: 20px 23px; background: #eee7da; display: grid; gap: 12px; }
.toc-label { font-size: 8px; letter-spacing: .16em; color: var(--muted); margin-bottom: 2px; }
.table-of-contents a { font: 400 14px var(--serif); text-decoration: none; }
.table-of-contents a:hover { color: var(--copper); }
.reader-body { padding-top: 44px; }
.reader-chapter { margin-bottom: 68px; scroll-margin-top: 30px; }
.chapter-title { font: 400 26px/1.25 var(--serif); margin: 0 0 22px; }
.chapter-text { font: 400 calc(18px * var(--reader-scale))/1.95 var(--serif); color: #39352e; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader-ending { border-top: 1px solid var(--line); padding: 35px 0 10px; display: grid; justify-items: center; gap: 12px; color: var(--muted); font-size: 8px; letter-spacing: .15em; }
.reader-ending p { margin: 0; }
.ending-ornament { color: var(--copper); font-size: 20px; }
.not-found { padding: 100px 0; text-align: center; max-width: 640px; margin: 0 auto; }
.not-found h1 { font: 400 clamp(36px, 5vw, 54px)/1.15 var(--serif); margin: 18px 0 13px; }
.not-found p { color: var(--muted); font: 14px/1.75 var(--serif); margin-bottom: 23px; }
[hidden] { display: none !important; }
@media (max-width: 920px) {
  .header-note { display: none; }
  .hero { gap: 4vw; }
  .catalog-grid { gap: 17px; }
  .work-cover { min-height: 205px; padding: 18px; }
  .editor-workspace { grid-template-columns: 210px minmax(0, 1fr); gap: 25px; }
  .form-grid { grid-template-columns: minmax(0, 1fr) 145px; }
}
@media (max-width: 680px) {
  .site-header { padding: 0 20px; }
  .header-inner { min-height: 75px; gap: 10px; flex-wrap: wrap; }
  .brand { gap: 8px; }
  .brand-name { font-size: 11px; }
  .brand-name small { font-size: 7px; }
  .brand-mark { transform: scale(.85); width: 24px; }
  .main-nav { order: 3; width: 100%; justify-content: center; gap: 26px; padding: 0 0 12px; }
  .main-nav a { font-size: 10px; }
  .header-side { margin-left: auto; }
  .header-cta { padding: 9px 11px; font-size: 9px; }
  .page-main { padding: 0 20px; }
  .hero { min-height: auto; padding: 52px 0 38px; grid-template-columns: 1fr; gap: 31px; }
  .hero h1 { font-size: clamp(42px, 12vw, 60px); }
  .hero-intro { font-size: 14px; }
  .hero-art { max-width: 100%; }
  .hero-actions { flex-wrap: wrap; gap: 14px; }
  .section-divider { font-size: 7px; min-height: 45px; }
  .library-section { padding: 45px 0 63px; }
  .section-heading { display: block; margin-bottom: 25px; }
  .section-heading h2 { font-size: 35px; }
  .section-subtitle { margin-top: 10px; }
  .catalog-controls { align-items: stretch; flex-direction: column; gap: 11px; margin-bottom: 20px; }
  .filter-group { flex-wrap: wrap; }
  .filter-button { padding: 8px 10px; }
  .search-box { width: 100%; }
  .catalog-grid { grid-template-columns: 1fr; gap: 29px; }
  .work-cover { min-height: 250px; }
  .work-title { font-size: 23px; }
  .work-description { min-height: 0; }
  .site-footer { padding: 18px 20px 24px; }
  .footer-row { flex-wrap: wrap; font-size: 8px; }
  .footer-mark { order: 3; width: 100%; }
  .admin-main { padding-top: 32px; }
  .login-panel { padding: 29px 23px; margin: 10px auto 38px; }
  .admin-intro { align-items: flex-start; flex-direction: column; padding-bottom: 24px; }
  .editor-workspace { display: flex; flex-direction: column; gap: 27px; padding-top: 25px; }
  .works-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 17px; }
  .admin-work-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .admin-work-item { padding: 10px 5px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-bottom { align-items: stretch; flex-direction: column; }
  .form-actions { justify-content: space-between; }
  .chapter-section-heading { align-items: flex-start; flex-direction: column; }
  .chapter-section-heading .button { align-self: flex-start; }
  .reader-main { padding-top: 17px; }
  .reader-toolbar { gap: 12px; }
  .reader-controls { gap: 5px; }
  .reader-article { padding: 37px 0 55px; }
  .reader-heading h1 { font-size: 43px; }
  .reader-description { font-size: 14px; }
  .reader-body { padding-top: 34px; }
  .chapter-text { font-size: calc(17px * var(--reader-scale)); line-height: 1.88; }
  .not-found { padding: 75px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
