/* Philosophy, Spoken: storefront styles.
   One face (EB Garamond, the book's own, SIL OFL), warm paper, and the dusk of the cover for the night bands.
   Gold is used for rules, ornaments and large type only; small text stays in ink or muted ink for contrast. */
@font-face { font-family: 'EB Garamond'; src: url('/assets/fonts/EBGaramond-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'EB Garamond'; src: url('/assets/fonts/EBGaramond-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'EB Garamond'; src: url('/assets/fonts/EBGaramond-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'EB Garamond'; src: url('/assets/fonts/EBGaramond-MediumItalic.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  --paper: #f3eee4;
  --paper-2: #ebe4d7;
  --card: #fbf8f2;
  --ink: #1d1b18;
  --muted: #5f584e;
  --rule: #d8cfbf;
  --gold: #a8874e;
  --gold-ink: #7d5f2a;
  --night: #18161b;
  --night-2: #221f26;
  --moon: #ece1c8;
  --moon-muted: #b9ae9a;
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
  font-size: clamp(18px, 1.05rem + 0.25vw, 21px);
  line-height: 1.6;
  font-feature-settings: 'kern', 'liga', 'onum';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--gold-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
::selection { background: #e6d6b2; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.sc { font-variant-caps: all-small-caps; letter-spacing: 0.14em; }
.eyebrow { font-variant-caps: all-small-caps; letter-spacing: 0.18em; font-size: 0.92em; color: var(--muted); margin: 0 0 0.9rem; }
.night .eyebrow { color: var(--moon-muted); }
.ornament { display: block; width: 46px; height: 1px; background: var(--gold); margin: 1.6rem 0; border: 0; }
.center .ornament, .ornament.center { margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* ── header ── */
.site-head { position: relative; z-index: 2; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 16px; }
.wordmark { font-size: 1.32rem; letter-spacing: 0.02em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.wordmark em { font-style: italic; }
.head-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 30px); font-size: 0.98rem; }
.head-nav a { text-decoration: none; }
.head-nav .quiet { color: var(--muted); }
.head-nav .buy-link { border-bottom: 1px solid var(--gold); padding-bottom: 1px; }
.site-head.on-night .wordmark, .site-head.on-night a { color: var(--moon); }
.site-head.on-night .quiet { color: var(--moon-muted); }
@media (max-width: 560px) { .head-nav .quiet { display: none; } }

/* ── night band (the cover's dusk) ── */
.night { background: radial-gradient(120% 80% at 78% 20%, #2b2630 0%, var(--night) 62%); color: var(--moon); }
.night a { color: var(--moon); }
.hero { padding: clamp(18px, 4vw, 40px) 0 clamp(64px, 10vw, 120px); margin-top: -76px; padding-top: calc(76px + clamp(18px, 5vw, 64px)); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 84px); align-items: center; }
.cover-frame { position: relative; max-width: 430px; justify-self: center; width: 100%; }
.cover-frame img { width: 100%; height: auto; aspect-ratio: 5 / 8; box-shadow: 0 2px 4px rgba(0,0,0,.25), 0 28px 60px -12px rgba(0,0,0,.65); }
.cover-frame::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.10) 0, rgba(255,255,255,0) 3%, rgba(0,0,0,.12) 3.6%, rgba(0,0,0,0) 7%); pointer-events: none; }
.title { font-weight: 400; font-size: clamp(1.9rem, 0.7rem + 3.4vw, 3.5rem); line-height: 1.08; letter-spacing: 0.06em; text-transform: uppercase; margin: 0; }
.subtitle { font-style: italic; font-size: clamp(1.3rem, 1rem + 1.1vw, 1.85rem); line-height: 1.3; margin: 1rem 0 0; color: var(--moon); }
.lede { font-size: clamp(1.12rem, 1rem + 0.4vw, 1.3rem); line-height: 1.55; max-width: 34em; margin: 0; }
.night .lede { color: #ddd2bb; }
.buy { margin-top: 2.2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.price { font-size: 2.1rem; line-height: 1; letter-spacing: 0.01em; }
.price small { font-size: 0.42em; letter-spacing: 0.12em; font-variant-caps: all-small-caps; color: var(--moon-muted); margin-left: 0.4em; }
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 1.06rem; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0.7rem 1.7rem; border-radius: 2px; text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-moon { background: var(--moon); color: var(--night); }
.btn-moon:hover { background: #fff6e2; color: var(--night); }
.btn-ink { background: var(--night); color: var(--moon); }
.btn-ink:hover { background: #2c2832; color: var(--moon); }
.btn-line { border-color: var(--rule); color: var(--ink); background: transparent; }
.btn-line:hover { border-color: var(--gold); color: var(--ink); }
.btn[aria-busy='true'] { opacity: .7; cursor: progress; }
.buy-note { flex-basis: 100%; margin: 0; font-size: 0.98rem; color: var(--moon-muted); }
.buy-error { flex-basis: 100%; margin: 0; font-size: 1rem; color: #f0b9a6; }
.paper .buy-note { color: var(--muted); }
.paper .buy-error { color: #9a3b22; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cover-frame { max-width: 300px; }
  .hero-copy { text-align: center; }
  .hero-copy .lede { margin: 0 auto; }
  .buy { justify-content: center; }
  .hero-copy .ornament { margin-left: auto; margin-right: auto; }
}

/* ── sections ── */
section { padding: clamp(64px, 10vw, 128px) 0; }
.paper { background: var(--paper); }
.paper-2 { background: var(--paper-2); }
.rule-top { border-top: 1px solid var(--rule); }
h2 { font-weight: 400; font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); line-height: 1.12; letter-spacing: 0.005em; margin: 0 0 1.2rem; }
h2 em { font-style: italic; }
h3 { font-weight: 500; font-size: 1.18rem; letter-spacing: 0.01em; margin: 0 0 0.35rem; }
p { margin: 0 0 1.1rem; }
.muted { color: var(--muted); }

/* today's reading */
.today { text-align: center; }
.today .date { font-size: 1.05rem; }
.reading { margin: 0 auto; max-width: 30em; }
.reading blockquote { margin: 0; font-size: clamp(1.4rem, 1.05rem + 1.3vw, 2.05rem); line-height: 1.4; font-style: normal; }
.reading blockquote p { margin: 0 0 0.6em; }
.reading blockquote.verse p { white-space: pre-line; }
.reading blockquote.long { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); line-height: 1.5; text-align: left; }
.reading figcaption { margin-top: 1.6rem; font-size: 1.04rem; color: var(--muted); }
.reading figcaption .who { color: var(--ink); font-variant-caps: all-small-caps; letter-spacing: 0.12em; font-size: 1.08em; }
.reading[aria-busy='true'] { opacity: 0.35; }
.today .after { margin-top: 2.2rem; font-size: 1rem; color: var(--muted); }

/* questions */
.questions { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.35rem); line-height: 1.35; font-style: italic; margin: 0 0 2rem; }
.prose p { max-width: 36em; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.source-note { font-size: 0.98rem; color: var(--muted); }

/* months */
.months { list-style: none; padding: 0; margin: clamp(32px, 5vw, 56px) 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(22px, 3vw, 36px) clamp(16px, 2.4vw, 28px); }
.months li { margin: 0; }
.months figure { margin: 0; }
.months .plate { aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper-2); }
.months .plate img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.months li:hover .plate img { transform: scale(1.035); }
.months .m { display: block; margin-top: 0.85rem; font-variant-caps: all-small-caps; letter-spacing: 0.16em; font-size: 0.92rem; color: var(--muted); }
.months .t { display: block; font-size: 1.32rem; line-height: 1.2; margin-top: 0.15rem; }
.months .q { display: block; font-size: 0.98rem; line-height: 1.45; color: var(--muted); margin-top: 0.3rem; font-style: italic; }
@media (max-width: 980px) { .months { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .months { grid-template-columns: repeat(2, minmax(0, 1fr)); } .months .t { font-size: 1.15rem; } }
.credits { margin-top: 2.2rem; font-size: 0.92rem; color: var(--muted); max-width: 52em; }

/* standard: figures */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: clamp(32px, 5vw, 56px) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.figures div { padding: 1.6rem 1rem; text-align: center; border-left: 1px solid var(--rule); }
.figures div:first-child { border-left: 0; }
.figures b { display: block; font-weight: 400; font-size: clamp(2.2rem, 1.6rem + 2.2vw, 3.4rem); line-height: 1; color: var(--ink); font-feature-settings: 'lnum'; }
.figures span { display: block; margin-top: 0.5rem; font-variant-caps: all-small-caps; letter-spacing: 0.14em; font-size: 0.95rem; color: var(--muted); }
@media (max-width: 640px) { .figures { grid-template-columns: repeat(2, 1fr); } .figures div:nth-child(3) { border-left: 0; } .figures div:nth-child(n+3) { border-top: 1px solid var(--rule); } }
.misquote { margin: 0 0 1.4rem; padding-left: 1.2rem; border-left: 1px solid var(--gold); }
.misquote .no { text-decoration: line-through; text-decoration-color: var(--gold); text-decoration-thickness: 1px; color: var(--muted); font-style: italic; }

/* editions */
.editions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); margin: clamp(28px, 4vw, 48px) 0; }
.edition { background: var(--card); border: 1px solid var(--rule); padding: clamp(22px, 3vw, 32px); }
.edition .fmt { font-variant-caps: all-small-caps; letter-spacing: 0.16em; color: var(--gold-ink); font-size: 1rem; margin: 0 0 0.4rem; }
.edition p { margin: 0; font-size: 1.02rem; color: var(--muted); }
@media (max-width: 820px) { .editions { grid-template-columns: 1fr; } }
.buy-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; border-top: 1px solid var(--rule); padding-top: clamp(24px, 3vw, 36px); }
.buy-panel .price { color: var(--ink); }
.buy-panel .price small { color: var(--muted); }
.buy-panel .buy { margin: 0; }

/* questions & answers */
.faq { margin: clamp(24px, 4vw, 40px) 0 0; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 1.15rem 2.2rem 1.15rem 0; position: relative; font-size: 1.16rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 0.2rem; top: 1.05rem; color: var(--gold-ink); font-size: 1.3rem; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 1.2rem; color: var(--muted); max-width: 40em; }

/* footer */
.site-foot { background: var(--night); color: var(--moon-muted); padding: clamp(48px, 7vw, 80px) 0 40px; font-size: 1rem; }
.site-foot a { color: var(--moon); }
.site-foot .wordmark { color: var(--moon); font-size: 1.5rem; }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px 48px; }
.foot-grid nav { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: flex-start; }
.foot-grid nav a { text-decoration: none; }
.foot-small { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid #2f2b34; font-size: 0.9rem; }

/* inner pages */
.page-head { padding: clamp(48px, 8vw, 104px) 0 clamp(24px, 4vw, 40px); }
.page-head h1 { font-weight: 400; font-size: clamp(2.2rem, 1.4rem + 3vw, 3.6rem); line-height: 1.08; margin: 0 0 1rem; }
.page-head .lede { color: var(--muted); }
.page-body { padding: 0 0 clamp(72px, 10vw, 128px); }
.legal h2 { font-size: 1.5rem; margin: 2.4rem 0 0.7rem; }
.legal p, .legal li { max-width: 40em; }
.legal ul { padding-left: 1.2rem; }
.panel { background: var(--card); border: 1px solid var(--rule); padding: clamp(24px, 4vw, 40px); }
.downloads { display: grid; gap: 14px; margin: 1.6rem 0; }
.download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 1rem 0; border-top: 1px solid var(--rule); }
.download:last-child { border-bottom: 1px solid var(--rule); }
.download .what b { display: block; font-weight: 500; }
.download .what span { color: var(--muted); font-size: 0.98rem; }
.status-line { color: var(--muted); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--rule); border-top-color: var(--gold-ink); border-radius: 50%; animation: spin 0.9s linear infinite; vertical-align: -1px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .spinner { animation: none; } .months .plate img { transition: none; } }
[hidden] { display: none !important; }

/* night variants and small helpers (no inline styles: the CSP forbids them) */
.night .figures, .night .figures div { border-color: #3a3540; }
.night .figures b { color: var(--moon); }
.night .figures span, .night .muted { color: var(--moon-muted); }
.night p { color: #ddd2bb; }
.night h2 { color: var(--moon); }
.night .misquote .no { color: var(--moon-muted); }
.price-note { margin: 0.5rem 0 0; font-size: 1rem; }
.fine { margin-top: 1.4rem; font-size: 0.98rem; }
.foot-about { margin: 0.6rem 0 0; max-width: 30em; }
.site-head.rule-bottom { border-bottom: 1px solid var(--rule); }
.page-head h1 em { font-style: italic; }
.buy.paper { background: none; }
.legal { font-size: 1.04em; }
.price { font-feature-settings: 'lnum'; }
.download .what { flex: 1 1 16rem; }
.download .btn { flex: none; min-width: 9.5rem; }

/* ── conversion layer: reassurance, sample, reasons, look inside, closing, mobile buy bar ── */
.lede-2 { margin: 1rem 0 0; font-size: 1.02rem; color: var(--moon-muted); max-width: 34em; }
.sample-link { font-size: 1.02rem; color: var(--moon-muted); text-decoration: underline; text-decoration-color: var(--gold); }
.night .sample-link { color: var(--moon-muted); }
.night .sample-link:hover { color: var(--moon); }
.assure { flex-basis: 100%; list-style: none; padding: 0; margin: 0.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; font-size: 0.95rem; color: var(--moon-muted); }
.assure li { position: relative; padding-left: 1.1rem; }
.assure li::before { content: '✓'; position: absolute; left: 0; color: var(--gold); }
.assure.on-paper { color: var(--muted); margin-top: 1.6rem; flex-direction: column; }
.assure.on-paper li::before { color: var(--gold-ink); }

.whys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px) clamp(32px, 6vw, 80px); margin-top: clamp(28px, 4vw, 48px); }
.why { border-top: 1px solid var(--gold); padding-top: 1.1rem; }
.why h3 { font-size: 1.32rem; font-weight: 400; font-style: italic; margin-bottom: 0.5rem; }
.why p { margin: 0; color: var(--muted); max-width: 32em; }
@media (max-width: 720px) { .whys { grid-template-columns: 1fr; } }

.pages { list-style: none; padding: 0; margin: clamp(28px, 4vw, 48px) 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); align-items: end; }
.pages li { margin: 0; }
.pages figure { margin: 0; }
.pages img { width: 100%; height: auto; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 16px 34px -14px rgba(40,30,15,.35); }
.pages figcaption { margin-top: 0.8rem; font-size: 0.98rem; color: var(--muted); font-style: italic; }
.phone { max-width: 72%; margin: 0 auto; padding: 9px; background: var(--night); border-radius: 22px; box-shadow: 0 16px 34px -14px rgba(20,15,10,.5); }
.phone img { border-radius: 14px; box-shadow: none; }
.phone-li figcaption { text-align: center; }
@media (max-width: 820px) {
  .pages { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; padding-bottom: 14px; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); -webkit-overflow-scrolling: touch; }
  .pages li { flex: 0 0 68%; scroll-snap-align: start; }
  .pages .phone-li { flex-basis: 52%; }
}
.inside-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: clamp(28px, 4vw, 44px); }
.inside-cta .sample-note { flex-basis: 100%; margin: 0; font-size: 0.98rem; }
.inside-cta .buy-error { flex-basis: 100%; margin: 0; color: #9a3b22; }

.closing .buy { justify-content: center; }
.closing .assure { justify-content: center; }
.closing p { max-width: 34em; margin-left: auto; margin-right: auto; }

/* mobile: a slim buy bar whenever no other buy button is on screen */
.sticky-buy { display: none; }
@media (max-width: 820px) {
  .sticky-buy { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(24, 22, 27, 0.97); color: var(--moon); border-top: 1px solid #3a3540; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .28s ease; }
  .sticky-buy.show { transform: none; }
  .sticky-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 560px; margin: 0 auto; }
  .sticky-t { display: flex; flex-direction: column; line-height: 1.25; font-size: 1rem; min-width: 0; }
  .sticky-t em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sticky-t span { font-size: 0.9rem; color: var(--moon-muted); }
  .sticky-buy .btn { min-height: 46px; padding: 0.5rem 1.2rem; font-size: 1rem; flex: none; }
  .site-foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

  /* tighter hero so the price and button sit near the fold */
  .hero { padding-top: calc(76px + 8px); padding-bottom: 56px; }
  .hero-grid { gap: 26px; }
  .cover-frame { max-width: 200px; }
  .hero-copy .ornament { margin: 1.1rem auto; }
  .subtitle { margin-top: 0.6rem; }
  .lede-2 { margin-left: auto; margin-right: auto; }
  .assure { justify-content: center; }
  .buy { margin-top: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { .sticky-buy { transition: none; } }
h2, .title, .subtitle, .questions { text-wrap: balance; }
@media (max-width: 820px) {
  .cover-frame { max-width: 160px; }
  .hero-copy .eyebrow { letter-spacing: 0.12em; font-size: 0.82em; margin-bottom: 0.6rem; }
  .hero .lede-2 { display: none; }
  .hero .lede { font-size: 1.08rem; }
}
