/* Libafile product page. Palette and type follow the app (docs/STYLE-GUIDE.md
   in the Libafile repo): library green, Source Serif 4 headings, Source Sans 3
   text, on the cream of the owl icon. Ochre is decoration only: rules and dots.
   No italics anywhere; both fonts are loaded upright only. */

:root {
  --bg: #FBFAF7;
  --surface: #F4F5F3;
  --line: #E2E4E0;
  --ink: #20242A;
  --ink-soft: #5A5F66;
  --head: #17473A;
  --accent: #1F5F4A;
  --accent-deep: #17362A;
  --accent-soft: #E5F1EB;
  --cream: #F5EED9;
  --ochre: #C7962B;

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1120px;
  --gutter: 20px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
* { font-style: normal; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--head); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
strong { font-weight: 600; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--accent-deep); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ── Header ─────────────────────────────────────────── */

.lf-header { border-bottom: 1px solid var(--line); }
.lf-header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 60px;
}
.lf-crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; color: var(--ink-soft); text-decoration: none;
}
.lf-crumb:hover { color: var(--ink); }
.lf-crumb-current { color: var(--ink); font-weight: 600; }
.lf-crumb-sep { color: var(--ochre); }
.lf-header-cta {
  font-size: 15px; font-weight: 600; color: var(--accent); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; white-space: nowrap;
}
.lf-header-cta:hover { background: var(--accent-soft); }

/* ── Shared bits ────────────────────────────────────── */

.eyebrow {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px;
}
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-title { font-size: clamp(30px, 6vw, 44px); max-width: 20ch; }
.section-lede { margin-top: 14px; max-width: 60ch; color: var(--ink-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 12px 24px; border-radius: 10px;
  font-size: 18px; font-weight: 600; text-decoration: none;
  transition: background .15s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-deep); color: #fff; }
.btn--quiet { border: 1px solid var(--line); background: #fff; color: var(--accent); }
.btn--quiet:hover { background: var(--accent-soft); }

/* ── Hero ───────────────────────────────────────────── */

.hero { padding: 40px 0 56px; overflow: hidden; }
.hero-grid { display: grid; gap: 44px; }
.hero-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.hero-brand img { width: 84px; height: auto; }
.hero-brand-name { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--head); }

.hero h1 { font-size: clamp(42px, 11vw, 66px); line-height: 1.04; letter-spacing: -0.02em; }
.hero-sub { margin-top: 20px; font-size: 20px; color: var(--ink-soft); max-width: 38ch; }
.hero-cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-cta-note { margin-top: 14px; font-size: 15px; color: var(--ink-soft); }
.hero-facts {
  margin: 30px 0 0; padding: 18px 0 0; list-style: none;
  border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-size: 16px; color: var(--ink-soft);
}
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ochre); }

.hero-visual { position: relative; }
.window {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: 0 30px 60px -32px rgba(23, 54, 42, .5);
}
.window-bar { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.window-bar span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }

/* ── Steps ──────────────────────────────────────────── */

.steps { display: grid; gap: 16px; margin-top: 36px; counter-reset: step; }
.step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 12px;
  border-radius: 50%; background: var(--accent-soft); color: var(--head);
  font-family: var(--serif); font-weight: 700; font-size: 16px;
}
.step h3 { font-size: 23px; }
.step p { margin-top: 8px; color: var(--ink-soft); }

/* ── Screenshot shelf ───────────────────────────────── */

.shelf {
  margin-top: 36px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 84%;
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px var(--gutter) 22px; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter));
  scrollbar-width: thin; scrollbar-color: var(--ochre) transparent;
}
.shelf figure { margin: 0; scroll-snap-align: center; }
.shelf img { border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 18px 34px -26px rgba(23, 54, 42, .5); }
.shelf figcaption { margin-top: 12px; font-size: 16px; color: var(--ink-soft); line-height: 1.45; }
.shelf figcaption strong { display: block; color: var(--head); font-family: var(--serif); font-size: 19px; }
.shelf-hint { font-size: 15px; color: var(--ink-soft); margin-top: 4px; }

.shot-open { display: block; border-radius: 10px; cursor: zoom-in; }
.shot-open img { transition: transform .15s ease; }
.shelf .shot-open:hover img { transform: translateY(-2px); }
/* The window clips its image, so the whole window moves. */
.hero-visual .window { transition: transform .15s ease; }
.hero-visual .window:hover { transform: translateY(-2px); }

.shot-view {
  display: none; position: fixed; inset: 0; z-index: 20;
  padding: 56px 16px 16px; background: rgba(251, 250, 247, .88);
  align-items: center; justify-content: center; cursor: zoom-out;
}
.shot-view:target { display: flex; }
.shot-view img { width: auto; max-width: 100%; max-height: 100%; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 24px 60px -24px rgba(32, 36, 42, .45); }
.shot-view-close {
  position: fixed; top: 12px; right: 16px;
  padding: 6px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--accent-deep); font-size: 15px; font-weight: 600;
}
@media (max-width: 639px) {
  .shot-view { justify-content: flex-start; overflow-x: auto; }
  .shot-view img { width: 900px; max-width: none; max-height: none; height: auto; flex: none; }
}

/* ── Features ───────────────────────────────────────── */

.features { display: grid; gap: 0; margin-top: 30px; border-top: 1px solid var(--line); }
.feature { padding: 22px 0; border-bottom: 1px solid var(--line); }
.feature h3 { font-size: 22px; }
.feature p { margin-top: 6px; color: var(--ink-soft); }

/* ── Who it's for ───────────────────────────────────── */

.shelves { display: grid; gap: 16px; margin-top: 36px; }
.shelf-card { padding: 24px; border-radius: var(--radius); background: var(--accent-deep); }
.shelf-card h3 { font-size: 24px; color: #fff; }
.shelf-card p { margin-top: 8px; color: #D7E6DE; }

/* ── Codexia ────────────────────────────────────────── */

.codexia { background: var(--cream); }
.section + .codexia, .codexia + .section { border-top: 0; }
.codexia-grid { display: grid; gap: 30px; align-items: center; }
.codexia-claim { margin-top: 18px; font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--head); line-height: 1.3; }
.codexia-body { margin-top: 14px; max-width: 58ch; }
.codexia-body + .codexia-body { margin-top: 12px; }
.codexia .window { box-shadow: none; }

/* ── Saving ─────────────────────────────────────────── */

.saving { display: grid; gap: 16px; margin-top: 36px; }
.saving-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: #fff; }
.saving-col h3 { font-size: 23px; }
.saving-col p { margin-top: 10px; color: var(--ink-soft); }
.saving-foot { margin-top: 20px; color: var(--ink-soft); max-width: 70ch; }

/* ── Privacy ────────────────────────────────────────── */

.privacy { background: var(--surface); }
.section + .privacy, .privacy + .section { border-top: 0; }
.privacy-grid { display: grid; gap: 30px; }
.privacy-body { color: var(--ink-soft); max-width: 62ch; margin-top: 18px; }
.privacy-body p + p { margin-top: 14px; }
.ledger { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 20px; align-self: start; }
.ledger-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: 16px; }
.ledger-row:last-child { border-bottom: 0; }
.ledger-key { color: var(--ink-soft); }
.ledger-val { font-weight: 600; text-align: right; }

/* ── FAQ ────────────────────────────────────────────── */

.faq { margin-top: 30px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 34px 18px 0; position: relative;
  font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--head);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 14px;
  font-family: var(--sans); font-size: 24px; color: var(--accent);
}
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 20px; color: var(--ink-soft); max-width: 68ch; }

/* ── Closing CTA ────────────────────────────────────── */

.closing { text-align: center; }
.closing img { width: 120px; margin: 0 auto 18px; }
.closing .section-title { margin: 0 auto; }
.closing .section-lede { margin: 14px auto 0; }
.closing .hero-cta { justify-content: center; }
.closing-legal { margin-top: 22px; font-size: 15px; color: var(--ink-soft); }

/* ── Footer ─────────────────────────────────────────── */

.lf-footer { border-top: 1px solid var(--line); padding: 30px 0 40px; font-size: 15px; color: var(--ink-soft); }
.lf-footer-inner { display: grid; gap: 14px; }
.lf-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.lf-footer a { color: var(--ink-soft); }
.lf-footer a:hover { color: var(--accent); }

/* ── Wider screens ──────────────────────────────────── */

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .shelf { grid-auto-columns: 56%; }
  .features { grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .shelves { grid-template-columns: 1fr 1fr; }
  .saving { grid-template-columns: 1fr 1fr; }
  .lf-footer-inner { grid-template-columns: 1fr auto; align-items: center; }
}

@media (min-width: 900px) {
  .section { padding: 92px 0; }
  .hero { padding: 68px 0 64px; }
  .hero-grid { grid-template-columns: 0.9fr 1.1fr; align-items: center; }
  .shelf {
    grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible;
    margin-left: 0; margin-right: 0; padding: 4px 0 0; row-gap: 32px;
  }
  .shelf-hint { display: none; }
  .shelves { grid-template-columns: repeat(4, 1fr); }
  .codexia-grid { grid-template-columns: 1fr 1fr; gap: 56px; }
  .privacy-grid { grid-template-columns: 1.2fr 0.8fr; gap: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
