/* ==========================================================================
   Booksfer, LLC - corporate site stylesheet
   Self-contained: no external fonts, scripts or assets.
   ========================================================================== */

:root {
  --paper:        #fbfaf8;
  --surface:      #ffffff;
  --surface-alt:  #f4f2ee;
  --ink:          #15151b;
  --ink-2:        #3d3d48;
  --muted:        #6e6e7b;
  --line:         #e7e3dc;
  --line-soft:    #f0ece5;
  --accent:       #d9542b;
  --accent-ink:   #a33d1d;
  --accent-wash:  #fdf2ed;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1100px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21,21,27,.04), 0 8px 24px rgba(21,21,27,.05);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.35rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.25rem); }
h3 { font-size: 1.24rem; }
h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 650; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.narrow { max-width: 760px; }

.eyebrow {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .9rem;
}

.lede { font-size: 1.16rem; color: var(--ink-2); }
.muted { color: var(--muted); }

/* ---------- Header ---------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,248,.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 68px; flex-wrap: wrap;
}

.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--serif); font-size: 1.3rem; font-weight: 600;
  color: var(--ink); letter-spacing: -.022em; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; color: var(--ink); }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  display: inline-block; padding: 7px 12px; border-radius: 8px;
  font-size: .94rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
}
.nav a:hover { background: var(--surface-alt); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-wash); }

/* ---------- Buttons --------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px;
  font-size: .95rem; font-weight: 600; font-family: var(--sans);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #d6d0c6; background: #fff; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }

/* ---------- Sections -------------------------------------------------- */

.section { padding: clamp(56px, 7vw, 92px) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 2.6rem; }

/* ---------- Hero ------------------------------------------------------ */

.hero { padding: clamp(64px, 9vw, 116px) 0 clamp(52px, 7vw, 88px); }
.hero h1 { max-width: 15ch; }
.hero .lede { max-width: 58ch; font-size: 1.22rem; }

/* ---------- Page head (inner pages) ----------------------------------- */

.page-head {
  padding: clamp(52px, 6.5vw, 84px) 0 clamp(34px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.page-head h1 { max-width: 20ch; }
.page-head .lede { max-width: 62ch; margin-bottom: 0; }

/* ---------- Cards / grid ---------------------------------------------- */

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.section-alt .card { background: var(--paper); }
.card h3 { margin-bottom: .45em; }
.card p { color: var(--ink-2); font-size: .97rem; margin-bottom: 0; }

.card-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-wash); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 18px;
}
.card-icon svg { width: 20px; height: 20px; }

/* ---------- Product panel --------------------------------------------- */

.product {
  display: grid; gap: 40px; align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}
@media (max-width: 860px) { .product { grid-template-columns: 1fr; gap: 30px; } }

.product-visual {
  background: linear-gradient(160deg, #1c1c22 0%, #26232a 100%);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow);
  color: #f5f3f0;
}
.product-visual .pv-brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
  padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.11); margin-bottom: 18px;
}
.product-visual .pv-brand svg { width: 24px; height: 24px; color: var(--accent); }
.pv-row { display: flex; align-items: center; gap: 13px; padding: 11px 0; }
.pv-row + .pv-row { border-top: 1px solid rgba(255,255,255,.07); }
.pv-icon {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.07);
}
.pv-icon svg { width: 21px; height: 21px; }
.pv-icon.read  { background: rgba(217,84,43,.15);  color: #ef7a51; }
.pv-icon.write { background: rgba(96,138,200,.15); color: #85aade; }
.pv-icon.earn  { background: rgba(97,148,113,.16); color: #7cb894; }
.pv-meta strong { display: block; font-size: .95rem; font-weight: 600; }
.pv-meta span { font-size: .82rem; color: rgba(245,243,240,.6); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.5rem; }
.tag {
  font-size: .82rem; font-weight: 500; color: var(--ink-2);
  background: var(--surface-alt); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
}
.section-alt .tag { background: var(--paper); }

/* ---------- Facts table ---------------------------------------------- */

.facts {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin: 0;
}
.facts div {
  display: grid; grid-template-columns: 232px 1fr; gap: 18px;
  padding: 15px 26px; border-top: 1px solid var(--line-soft);
}
.facts div:first-child { border-top: 0; }
.facts dt { font-size: .88rem; font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; font-size: .97rem; color: var(--ink); }
.facts dd .mono { font-family: var(--mono); font-size: .92rem; }
@media (max-width: 620px) {
  .facts div { grid-template-columns: 1fr; gap: 3px; padding: 14px 20px; }
}

/* ---------- Contact cards -------------------------------------------- */

.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 26px; }
.contact-card h3 { font-family: var(--sans); font-size: 1rem; font-weight: 650; margin-bottom: 1em; }
.contact-card address { font-style: normal; color: var(--ink-2); font-size: .97rem; line-height: 1.7; }

.contact-lead {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(30px, 4.5vw, 46px);
  margin-bottom: 20px;
}
.contact-lead .eyebrow { margin-bottom: .7rem; }
.contact-lead .addr {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.022em;
  font-size: clamp(1.45rem, 1.05rem + 1.7vw, 2.05rem);
  margin: 0 0 .55rem; line-height: 1.2;
}
.contact-lead .addr a { color: var(--ink); }
.contact-lead .addr a:hover { color: var(--accent-ink); }
.contact-lead .muted { max-width: 52ch; font-size: .97rem; }

.contact-topics { list-style: none; margin: 0; padding: 0; }
.contact-topics li { padding: 15px 0; border-top: 1px solid var(--line-soft); }
.contact-topics li:first-child { border-top: 0; padding-top: 0; }
.contact-topics li:last-child { padding-bottom: 0; }
.contact-topics strong { display: block; font-size: .97rem; font-weight: 650; margin-bottom: .25em; }
.contact-topics span { font-size: .93rem; color: var(--muted); }

/* ---------- Legal prose ---------------------------------------------- */

.legal { padding: clamp(46px, 6vw, 72px) 0 clamp(60px, 8vw, 96px); }
.legal .toc {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 3rem;
}
.legal .toc h2 { font-family: var(--sans); font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .9em;
  border: 0; padding: 0; margin-top: 0; }
.legal .toc ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 34px; }
.legal .toc li { font-size: .93rem; margin-bottom: .35em; break-inside: avoid; }
@media (max-width: 620px) { .legal .toc ol { columns: 1; } }

.legal h2 {
  font-size: 1.4rem; margin-top: 2.6em; padding-top: 1.4em;
  border-top: 1px solid var(--line);
}
.legal h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.legal h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 650; margin-top: 1.9em; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul, .legal ol { padding-left: 1.35em; margin: 0 0 1.1em; }
.legal li { margin-bottom: .5em; }
.legal .updated {
  display: inline-block; font-size: .86rem; color: var(--muted);
  background: var(--surface-alt); border: 1px solid var(--line);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 2.4rem;
}

/* ---------- CTA ------------------------------------------------------- */

.cta {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(34px, 5vw, 54px);
  text-align: center;
}
.cta h2 { margin-bottom: .4em; }
.cta p { max-width: 52ch; margin-inline: auto; color: var(--ink-2); }
.cta .btn-row { justify-content: center; }

/* ---------- Footer ---------------------------------------------------- */

.site-footer {
  background: var(--surface); border-top: 1px solid var(--line);
  padding: clamp(48px, 6vw, 68px) 0 34px;
}
.footer-top {
  display: grid; gap: 40px;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
}
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 480px) { .footer-top { grid-template-columns: 1fr; } }

.footer-about p { font-size: .93rem; color: var(--muted); max-width: 34ch; margin-top: 1rem; }
.footer-col h4 {
  font-family: var(--sans); font-size: .74rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.1em;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .6em; }
.footer-col a { font-size: .93rem; color: var(--ink-2); }
.footer-col a:hover { color: var(--accent-ink); }

.footer-legal {
  margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line);
  font-size: .86rem; color: var(--muted); line-height: 1.75;
}
.footer-legal address { font-style: normal; display: inline; }
.footer-legal .reg { margin-top: .7em; }
.footer-legal .reg span { white-space: nowrap; }
.footer-legal .sep { color: var(--line); margin-inline: .55em; }

.ext::after { content: " \2197"; font-size: .85em; opacity: .6; }
