/* Papyrus — "Reading Room" website
   Palette & type mirror the app's DESIGN.md. Light + dark aware. */

:root {
  --bg: #f7f2e9;          /* parchment */
  --surface: #fffdf8;     /* cream */
  --surface-2: #f2ead9;
  --ink: #2b211a;         /* espresso */
  --ink-muted: #6b5d4f;
  --accent: #b08a47;      /* brass */
  --accent-ink: #8a6a33;
  --wood-top: #7a5230;
  --wood-bottom: #5c3d22;
  --hairline: rgba(43, 33, 26, 0.12);
  --shadow: 0 18px 50px -20px rgba(43, 33, 26, 0.35);
  --radius: 16px;
  --serif: "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1713;        /* dark walnut room */
    --surface: #26201a;
    --surface-2: #201a15;
    --ink: #efe6d8;
    --ink-muted: #a69880;
    --accent: #c9a45c;
    --accent-ink: #d8b674;
    --wood-top: #4a3220;
    --wood-bottom: #332214;
    --hairline: rgba(239, 230, 216, 0.12);
    --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: radial-gradient(rgba(43, 33, 26, 0.035) 1px, transparent 1px);
  background-size: 4px 4px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.narrow { max-width: 760px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; margin: 0; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(1.4) blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--hairline);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand .mark { width: 26px; height: 26px; border-radius: 6px; background: linear-gradient(160deg, var(--wood-top), var(--wood-bottom)); display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); }
.brand .mark::after { content: ""; width: 12px; height: 3px; background: var(--accent); border-radius: 2px; box-shadow: 0 5px 0 var(--accent), 0 -5px 0 rgba(255,253,248,0.7); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--ink-muted); text-decoration: none; font-size: 15px; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 620px) { .nav-links a.hide-sm { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--accent); color: #241a0d; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { transform: translateY(-1px); color: #241a0d; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; margin-bottom: 20px; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); }
.hero h1 { font-size: clamp(40px, 6vw, 60px); }
.hero p.lede { font-size: 20px; color: var(--ink-muted); margin: 22px 0 30px; max-width: 30ch; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero .note { font-size: 13px; color: var(--ink-muted); margin-top: 16px; }

/* ---------- CSS bookcase of front covers (hero art) ---------- */
.bookcase {
  border-radius: 20px;
  padding: 18px 18px 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--wood-top) 88%, black), var(--wood-bottom));
  box-shadow: var(--shadow), inset 0 2px 0 rgba(255,255,255,0.08);
  position: relative;
}
.cover-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; padding: 0 6px 14px;
  border-bottom: 12px solid var(--wood-bottom);
  border-radius: 3px;
  box-shadow: 0 10px 8px -10px rgba(0,0,0,0.5);
  margin-bottom: 8px;
}
.cover-row:last-child { border-bottom: none; margin-bottom: 0; }
.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 2px 4px 4px 2px;
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 rgba(0,0,0,0.28), inset 5px 0 7px rgba(0,0,0,0.22),
              inset -1px 0 0 rgba(255,255,255,0.10), 0 4px 9px rgba(0,0,0,0.34);
  overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover::after { /* soft sheen + spine-edge shading over the art */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(105deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 40%),
    linear-gradient(90deg, rgba(0,0,0,0.22), rgba(0,0,0,0) 8%);
}

/* ---------- Sections ---------- */
section { padding: 64px 0; position: relative; z-index: 1; }

/* privacy strip */
.privacy-strip {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 22px;
  padding: 44px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center;
}
@media (max-width: 720px) { .privacy-strip { grid-template-columns: 1fr; text-align: left; } }
.privacy-strip h2 { font-size: 30px; }
.privacy-strip p { color: var(--ink-muted); margin: 12px 0 0; max-width: 52ch; }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pill { font-size: 13.5px; font-weight: 600; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid var(--hairline); padding: 7px 13px; border-radius: 999px; }

/* ---------- Discover / Analytics (screenshot + copy) sections ---------- */
.discover-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 56px; align-items: center; }
.discover-grid.reverse { grid-template-columns: 1.05fr 0.95fr; }
.discover-grid.reverse .app-shot { order: -1; }
@media (max-width: 860px) {
  .discover-grid, .discover-grid.reverse { grid-template-columns: 1fr; gap: 36px; }
  .discover-grid.reverse .app-shot { order: 0; }
}
.discover-copy h2 { font-size: clamp(28px, 4vw, 40px); }
.discover-copy > p { color: var(--ink-muted); font-size: 18px; margin: 16px 0 28px; max-width: 46ch; }

/* real app screenshot, presented as a soft floating card */
.app-shot { display: flex; justify-content: center; }
.app-shot img {
  width: 100%; max-width: 340px; display: block;
  border-radius: 22px; border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--hairline); padding: 40px 0; position: relative; z-index: 1; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
footer .brand { font-size: 18px; }
footer .links { display: flex; gap: 24px; }
footer .links a { color: var(--ink-muted); text-decoration: none; font-size: 14px; }
footer .links a:hover { color: var(--ink); }
footer small { color: var(--ink-muted); display: block; margin-top: 4px; font-size: 13px; }

/* ---------- Legal / privacy page ---------- */
.legal { padding: 56px 0 40px; }
.legal .eyebrow { margin-bottom: 14px; }
.legal h1 { font-size: clamp(34px, 5vw, 46px); }
.legal .updated { color: var(--ink-muted); font-size: 14px; margin-top: 12px; }
.legal-body { margin-top: 40px; }
.legal-body section { padding: 20px 0; }
.legal-body h2 { font-size: 24px; margin: 20px 0 10px; }
.legal-body h3 { font-size: 18px; margin: 18px 0 6px; }
.legal-body p, .legal-body li { color: var(--ink); }
.legal-body p { margin: 8px 0; }
.legal-body ul { padding-left: 22px; margin: 8px 0; }
.legal-body li { margin: 5px 0; }
.legal-body .lead { font-size: 19px; color: var(--ink-muted); }
.legal-body strong { color: var(--ink); }
.callout {
  background: var(--surface); border: 1px solid var(--hairline); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 18px 22px; margin: 24px 0;
}
.callout p { margin: 0; }
.toc { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 20px 24px; margin-top: 28px; }
.toc strong { font-family: var(--serif); font-size: 15px; }
.toc ul { list-style: none; padding: 0; margin: 10px 0 0; columns: 2; column-gap: 24px; }
.toc li { margin: 6px 0; }
.toc a { text-decoration: none; font-size: 15px; }
@media (max-width: 560px) { .toc ul { columns: 1; } }
