
:root{
  --bg:#f6f1e7;
  --paper:#fffdf8;
  --card:#ffffff;
  --ink:#243225;
  --muted:#70756c;
  --green:#536b4d;
  --green-dark:#31452f;
  --green-soft:#dfe6d5;
  --orange:#d9853d;
  --orange-soft:#f7e6d5;
  --line:#e8e0d3;
  --shadow:0 14px 40px rgba(55,54,43,.10);
  --shadow-soft:0 8px 24px rgba(55,54,43,.08);
  --radius:24px;
  --radius-sm:16px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;background:var(--bg)}
body{
  margin:0;
  background:
    radial-gradient(circle at 95% 4%, rgba(176,193,151,.28) 0 110px, transparent 111px),
    radial-gradient(circle at 2% 96%, rgba(239,194,151,.22) 0 100px, transparent 101px),
    var(--bg);
  color:var(--ink);
  font-family:"DM Sans",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
}
button,a{font:inherit}
a{color:inherit}
img{max-width:100%}
[hidden]{display:none!important}

.shell{min-height:100vh}
.topbar{
  width:min(1120px,100%);
  margin:0 auto;
  padding:20px 22px 10px;
}
.brand{
  display:inline-flex;
  align-items:center;
  gap:11px;
  text-decoration:none;
}
.brand-mark{
  width:42px;height:42px;border-radius:50%;
  display:grid;place-items:center;
  background:var(--green);
  color:#fff;
  font:700 21px/1 "Fraunces",serif;
  box-shadow:0 6px 18px rgba(83,107,77,.25);
}
.brand b{
  display:block;
  font:700 17px/1.05 "Fraunces",serif;
  letter-spacing:-.01em;
}
.brand small{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:11px;
}
.hero{
  width:min(920px,calc(100% - 34px));
  margin:28px auto 18px;
  text-align:center;
  padding:28px 18px 22px;
}
.eyebrow,.section-kicker,.reader-chip{
  display:inline-flex;
  align-items:center;
  letter-spacing:.14em;
  font-weight:700;
  font-size:10px;
  color:var(--orange);
}
.hero h1{
  margin:10px auto 10px;
  max-width:720px;
  font:700 clamp(34px,6vw,56px)/1.02 "Fraunces",serif;
  letter-spacing:-.035em;
}
.hero p{
  max-width:650px;
  margin:0 auto;
  color:var(--muted);
  line-height:1.65;
  font-size:15px;
}
.library-section{
  width:min(1120px,calc(100% - 34px));
  margin:0 auto;
  padding:18px 0 44px;
}
.section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:20px;
  margin:0 0 18px;
}
.section-head h2{
  margin:5px 0 0;
  font:700 27px/1.08 "Fraunces",serif;
}
.book-count{
  white-space:nowrap;
  color:var(--muted);
  font-size:12px;
}
.library{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
.book-card{
  position:relative;
  display:grid;
  grid-template-columns:180px minmax(0,1fr);
  gap:20px;
  align-items:center;
  background:rgba(255,255,255,.9);
  border:1px solid rgba(91,87,69,.10);
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow-soft);
  overflow:hidden;
}
.book-card.featured{
  grid-column:1/-1;
  grid-template-columns:minmax(230px,310px) minmax(0,1fr);
  padding:22px;
  background:
    linear-gradient(135deg,rgba(255,255,255,.96),rgba(249,247,239,.96));
  border-color:rgba(83,107,77,.18);
  box-shadow:var(--shadow);
}
.book-card.featured:before{
  content:"";
  position:absolute;
  width:220px;height:220px;
  right:-95px;top:-105px;
  border-radius:50%;
  background:rgba(176,193,151,.22);
}
.cover-wrap{
  position:relative;
  border-radius:18px;
  overflow:hidden;
  background:#eee9df;
  aspect-ratio:4/5.25;
  box-shadow:0 10px 24px rgba(42,43,35,.14);
}
.cover-wrap img{
  width:100%;height:100%;
  object-fit:cover;
  object-position:top center;
  display:block;
}
.cover-badge{
  position:absolute;
  top:10px;left:10px;
  z-index:2;
  display:inline-flex;
  padding:6px 9px;
  border-radius:999px;
  background:rgba(255,255,255,.93);
  backdrop-filter:blur(8px);
  color:var(--orange);
  font-weight:800;
  font-size:9px;
  letter-spacing:.10em;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}
.featured .cover-badge{
  background:var(--green-dark);
  color:#fff;
}
.book-copy{position:relative;z-index:1}
.book-copy h3{
  margin:0;
  font:700 26px/1.05 "Fraunces",serif;
  letter-spacing:-.025em;
}
.featured .book-copy h3{font-size:clamp(30px,4vw,42px)}
.book-copy p{
  margin:9px 0 16px;
  color:var(--muted);
  line-height:1.55;
  font-size:13.5px;
}
.book-meta{
  display:flex;align-items:center;gap:10px;
  margin-bottom:16px;
  color:var(--muted);
  font-size:11px;
}
.dot-sep{width:3px;height:3px;border-radius:50%;background:#b5b4aa}
.actions{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:43px;
  padding:0 15px;
  border-radius:13px;
  border:1px solid transparent;
  text-decoration:none;
  cursor:pointer;
  font-weight:700;
  font-size:12.5px;
}
.btn-primary{background:var(--orange);color:#fff;box-shadow:0 7px 18px rgba(217,133,61,.22)}
.btn-secondary{background:#fff;color:var(--green-dark);border-color:var(--line)}
.empty{
  grid-column:1/-1;
  background:#fff;
  border:1px dashed #d9d0c1;
  border-radius:20px;
  padding:32px;
  text-align:center;
  color:var(--muted);
}
.footer{
  width:min(1120px,calc(100% - 34px));
  margin:0 auto;
  padding:0 0 36px;
  text-align:center;
  color:#8a8c84;
  font-size:11px;
  line-height:1.6;
}

/* reader */
.reader-view{
  min-height:100vh;
  background:#eee9df;
}
.reader-top{
  position:sticky;
  top:0;
  z-index:20;
  min-height:66px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:9px max(14px,env(safe-area-inset-right)) 9px max(14px,env(safe-area-inset-left));
  background:rgba(255,253,248,.94);
  backdrop-filter:blur(14px);
  border-bottom:1px solid rgba(83,72,56,.09);
}
.reader-back{
  border:0;background:transparent;color:var(--green-dark);
  display:flex;align-items:center;gap:5px;
  padding:8px 6px;cursor:pointer;font-weight:700;font-size:12px;
}
.reader-back span:first-child{font-size:20px;line-height:1}
.reader-title-wrap{min-width:0;text-align:center}
.reader-title{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  font-weight:700;font-size:12px;
}
.reader-meta{font-size:9.5px;color:var(--muted);margin-top:2px}
.reader-download{
  text-decoration:none;
  background:var(--green-dark);
  color:#fff;
  border-radius:10px;
  padding:9px 11px;
  font-weight:700;
  font-size:11px;
}
.progress-track{
  position:sticky;top:66px;z-index:19;height:3px;background:rgba(83,107,77,.10)
}
.progress-bar{height:100%;width:0;background:var(--orange);transition:width .12s linear}
.reader-body{
  width:min(900px,100%);
  margin:0 auto;
  padding:24px 14px 50px;
}
.reader-intro{
  padding:14px 4px 18px;
  text-align:center;
}
.reader-intro h1{
  margin:7px 0 7px;
  font:700 29px/1.08 "Fraunces",serif;
}
.reader-intro p{
  margin:0 auto;
  max-width:520px;
  color:var(--muted);
  line-height:1.5;
  font-size:12px;
}
.pages{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}
.page{
  width:100%;
  max-width:820px;
  background:#fff;
  border-radius:8px;
  overflow:hidden;
  box-shadow:0 8px 28px rgba(50,48,42,.11);
}
.page img{
  display:block;
  width:100%;
  height:auto;
  background:#fff;
}
.page-no{
  padding:7px 10px;
  text-align:center;
  color:#94948d;
  background:#faf9f6;
  border-top:1px solid #f0eee8;
  font-size:9px;
}
.reader-end{
  max-width:520px;
  margin:28px auto 0;
  padding:30px 20px;
  text-align:center;
  background:var(--paper);
  border-radius:22px;
  box-shadow:var(--shadow-soft);
}
.reader-end-icon{
  width:44px;height:44px;border-radius:50%;display:grid;place-items:center;
  margin:0 auto 10px;background:var(--green-soft);color:var(--green-dark);
  font-size:22px;font-weight:700
}
.reader-end h2{font:700 25px/1.1 "Fraunces",serif;margin:0}
.reader-end p{color:var(--muted);font-size:12px}
.primary-action,.secondary-action{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:47px;
  border-radius:13px;
  margin-top:9px;
  font-weight:700;
  font-size:13px;
  cursor:pointer;
  text-decoration:none;
}
.primary-action{background:var(--orange);color:#fff;border:0}
.secondary-action{background:#fff;border:1px solid var(--line);color:var(--green-dark)}

@media(max-width:820px){
  .library{grid-template-columns:1fr}
  .book-card,.book-card.featured{
    grid-column:auto;
    grid-template-columns:120px minmax(0,1fr);
    padding:14px;
    gap:14px;
    border-radius:20px;
  }
  .featured .book-copy h3,.book-copy h3{font-size:24px}
  .book-copy p{font-size:12.5px;margin:7px 0 12px}
}
@media(max-width:560px){
  .topbar{padding:15px 16px 4px}
  .brand-mark{width:38px;height:38px;font-size:19px}
  .hero{margin-top:18px;padding:19px 8px 16px}
  .hero h1{font-size:36px}
  .hero p{font-size:13.5px}
  .library-section{width:calc(100% - 24px);padding-top:10px}
  .section-head{align-items:flex-start}
  .section-head h2{font-size:23px}
  .book-count{display:none}
  .book-card,.book-card.featured{
    grid-template-columns:98px minmax(0,1fr);
    padding:12px;
    gap:12px;
    border-radius:18px;
  }
  .book-card.featured{
    grid-template-columns:125px minmax(0,1fr);
    padding:13px;
  }
  .book-copy h3,.featured .book-copy h3{font-size:21px}
  .book-copy p{font-size:11.5px;line-height:1.42;margin-bottom:10px}
  .book-meta{font-size:9.5px;margin-bottom:10px;gap:7px}
  .actions{gap:7px}
  .btn{min-height:39px;padding:0 11px;border-radius:11px;font-size:11.5px}
  .cover-badge{top:7px;left:7px;font-size:7.5px;padding:5px 7px}
  .reader-top{grid-template-columns:auto minmax(0,1fr) auto}
  .reader-back span:last-child{display:none}
  .reader-download{padding:8px 10px}
  .reader-body{padding:18px 7px 40px}
  .pages{gap:10px}
  .page{border-radius:5px}
  .reader-intro h1{font-size:25px}
}
