:root {
  --paper: #f6f3ec;
  --card: #fffdf8;
  --ink: #1c1a17;
  --muted: #6b655c;
  --line: #e4ded1;
  --accent: #b4491f;
  --accent-dark: #8f3a18;
  --shadow: 0 1px 2px rgba(28, 26, 23, .06), 0 8px 24px rgba(28, 26, 23, .08);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-underline-offset: 3px; }
a, button { -webkit-tap-highlight-color: transparent; }
button, .btn { touch-action: manipulation; }
img { display: block; max-width: 100%; }

.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink);
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(246, 243, 236, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  min-height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { text-decoration: none; color: var(--ink); line-height: 1.15; }
.brand-name { display: block; font-family: Georgia, serif; font-size: 21px; font-weight: 600; }
.brand-tag { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 13px; text-decoration: none; color: var(--ink);
  font-size: 15px; border-radius: 6px;
}
.nav a:hover { background: rgba(28, 26, 23, .05); }
.menu-toggle {
  display: none; min-width: 46px; min-height: 46px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 8px; font: inherit; cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px; border-radius: 8px;
  text-decoration: none; font-weight: 600; font-size: 16px; cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-buy { background: var(--ink); color: #fff; width: 100%; }
.btn-buy:hover { background: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 48px; text-align: center; }
.eyebrow {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 8px;
}
.hero .eyebrow {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px; font-weight: 700;
}
.hero h1 { font-size: clamp(34px, 5vw, 56px); margin: 0 auto 18px; max-width: 720px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- sections ---------- */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-size: clamp(26px, 3.4vw, 36px); }
.section-head a { text-decoration: none; font-weight: 600; }
.section-head .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 8px; }

/* ---------- book grid ---------- */
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
.book {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.book:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(28, 26, 23, .14); }
.book-cover {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover;
  background: #ece6d8; border-bottom: 1px solid var(--line);
}
.book-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.book-title { font-size: 18px; margin: 0; }
.book-author { font-size: 13px; color: var(--muted); margin: 0; }
.book-price { font-size: 15px; font-weight: 700; margin: 2px 0; }
.book-desc { font-size: 14px; color: var(--muted); margin: 4px 0 10px; }
.book .btn { margin-top: auto; }

/* ---------- blog feed ---------- */
.post-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.post-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--line); background: #ece6d8; }
.post-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.post-date { font-size: 13px; color: var(--muted); letter-spacing: .03em; }
.post-title { margin: 0; font-size: 22px; }
.post-title a { color: var(--ink); text-decoration: none; }
.post-title a:hover { color: var(--accent); }
.post-excerpt { color: var(--muted); margin: 0; font-size: 15px; }
.empty { color: var(--muted); font-style: italic; }

/* ---------- article (post page) ---------- */
.post-page { max-width: 720px; margin: 0 auto; padding: 48px 0; }
.post-page .post-date { display: block; margin-bottom: 8px; }
.post-page h1 { font-size: clamp(30px, 5vw, 44px); margin: 0 0 20px; }
.post-page .post-hero { border-radius: 12px; margin: 8px 0 24px; }
.post-page .content { font-size: 17px; }
.post-page .content p { margin: 0 0 18px; color: var(--ink); }
.post-page .content h2 { margin: 32px 0 12px; }
.post-page .content h3 { margin: 26px 0 10px; }
.post-page .content a { color: var(--accent); }
.post-page .content ul { padding-left: 22px; margin: 0 0 18px; }
.back-link { display: inline-block; min-height: 44px; margin-bottom: 24px; text-decoration: none; font-weight: 600; }

/* ---------- services ---------- */
.service-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.service-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; box-shadow: var(--shadow);
}
.service-card h3 { margin: 0 0 10px; font-size: 20px; }
.service-card p.lead { color: var(--muted); font-size: 15px; margin: 0 0 4px; }
.service-card h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 16px 0 6px;
}
.service-card .tags { font-size: 14px; color: var(--ink); margin: 0; }
.service-num { font-size: 12px; letter-spacing: .1em; color: var(--accent); font-weight: 700; }
.values { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); }
.values li:before { content: '•'; color: var(--accent); margin-right: 9px; }

/* ---------- about / contact ---------- */
.prose { max-width: 720px; }
.prose h2 { margin: 0 0 16px; }
.prose p { color: var(--muted); margin: 0 0 16px; font-size: 17px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-links { display: grid; gap: 0; }
.contact-links a {
  display: block; padding: 16px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.contact-links small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .08em; }
.contact-links span { font-size: 17px; overflow-wrap: anywhere; }
.contact-links a:hover span { text-decoration: underline; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #efeadd; margin-top: 40px; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px 0; }
.footer-row nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-row nav a { color: var(--ink); text-decoration: none; font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
.footer-row nav a:hover { color: var(--accent); }
.footer-row .fine { font-size: 13px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .header-row { min-height: 64px; }
  .brand-name { font-size: 19px; }
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 8px 16px 16px; gap: 0;
  }
  .nav.open { display: flex; }
  .nav a { min-height: 48px; justify-content: flex-start; font-size: 16px; }
  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: clamp(30px, 8.5vw, 40px); }
  .hero p.lead { font-size: 16px; }
  .section { padding: 40px 0; }
  .section-head a { min-height: 44px; display: inline-flex; align-items: center; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .post-list { grid-template-columns: 1fr; gap: 18px; }
  .service-grid { grid-template-columns: 1fr; gap: 16px; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-row { flex-direction: column; align-items: flex-start; }
  .post-page { padding: 32px 0; }
  .post-page .content { font-size: 16px; }
  .prose p { font-size: 16px; }
}

@media (max-width: 420px) {
  .wrap { width: calc(100% - 28px); }
  .brand-name { font-size: 18px; }
  .brand-tag { font-size: 11px; }
  .hero .actions { flex-direction: column; align-items: stretch; }
  .hero .actions .btn { width: 100%; }
  .book-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .book-body { padding: 12px 12px 14px; }
  .book-title { font-size: 16px; }
  .book-price { font-size: 14px; }
  .book-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .service-card { padding: 20px; }
}

@media (max-width: 340px) {
  .book-grid { grid-template-columns: 1fr; }
}
