/* Code Created by Asplin Tech, Will@AsplinTech.com. Do not reuse without permission. */
/* Memoir website styles. Colours follow the app's Sepia palette (src/constants/themes.js),
   radii and spacing follow src/components/tokens.js. Copied to /assets/site.css by
   docs/site/build.js. */

@font-face {
  font-family: 'Playfair Display';
  src: url('/assets/fonts/PlayfairDisplay-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  /* Sepia, light */
  --primary: #8B4513;
  --accent: #D2691E;
  --bg: #FDF5E6;
  --surface: #FAF0DC;
  --surface-alt: #F5E6C8;
  --text: #2A1A0E;
  --text-2: #6B5335;
  --border: #BF9B6A;
  --button-bg: rgba(139, 69, 19, 0.15);
  --on-primary: #FFFFFF;
  --rule: rgba(191, 155, 106, 0.45);
  --shadow: 0 1px 2px rgba(42, 26, 14, 0.08), 0 6px 18px rgba(42, 26, 14, 0.08);

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

  --r-sm: 8px;
  --r-md: 16px;
  --r-pill: 999px;
  --gutter: 16px;
  --measure: 72ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Sepia, dark */
    --primary: #D2B48C;
    --accent: #DEB887;
    --bg: #1A0F08;
    --surface: #2D1F15;
    --surface-alt: #3D2B1F;
    --text: #F5DEB3;
    --text-2: #BFA58F; /* lighter than the app's #A0826D so it passes 4.5:1 on --surface */
    --border: #4A3628;
    --button-bg: rgba(210, 180, 140, 0.15);
    --on-primary: #1A0F08;
    --rule: rgba(160, 130, 109, 0.35);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.3);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  overflow-wrap: break-word;
}

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

a { color: var(--primary); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(2rem, 6vw, 2.75rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.5rem, 4vw, 1.9rem); margin: 2em 0 .5em; }
h3 { font-size: 1.25rem; margin: 1.6em 0 .4em; }
p, ul, ol { margin: 0 0 1em; }
li + li { margin-top: .3em; }
strong { font-weight: 600; }
code, kbd { font-family: var(--mono); font-size: .9em; background: var(--surface-alt); padding: .1em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: var(--r-sm);
}
.skip-link:focus { top: 8px; }

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

/* Header and navigation */
.site-header { border-bottom: 1px solid var(--rule); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand span { font-family: var(--serif); font-size: 1.5rem; letter-spacing: .04em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; }
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: inline-block; padding: 8px 10px; min-height: 40px; border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none; font-size: .95rem;
}
.site-nav a:hover { color: var(--primary); background: var(--button-bg); }
.site-nav a[aria-current="page"] { color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); border-radius: 0; }

/* Footer */
.site-footer { margin-top: 64px; border-top: 1px solid var(--rule); background: var(--surface); color: var(--text-2); font-size: .92rem; }
.site-footer .wrap { padding-top: 28px; padding-bottom: 36px; }
.site-footer .site-nav { margin-bottom: 12px; }
.site-footer .site-nav a { padding: 6px 8px; }
.site-footer p { margin: .4em 0; }
.site-footer a { color: var(--primary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 22px;
  border-radius: var(--r-pill); font-weight: 600; text-decoration: none; font-size: 1rem;
  border: 1px solid var(--primary);
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--button-bg); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn small { display: block; font-weight: 400; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; opacity: .9; line-height: 1.1; }
.btn .btn-label { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }

/* Home: hero */
.hero { padding: 48px 0 24px; }
.hero .wrap { display: grid; gap: 32px; align-items: center; }
.hero-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); }
.hero h1 { margin-top: 18px; }
.tagline { font-size: 1.2rem; color: var(--text-2); max-width: 38ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 8px; }
.hero-note { font-size: .9rem; color: var(--text-2); }
.hero-shot { justify-self: center; }
.phone {
  display: block; width: 100%; max-width: 280px; border-radius: 22px;
  border: 6px solid var(--surface-alt); box-shadow: var(--shadow); background: var(--surface);
}
@media (min-width: 820px) {
  .hero { padding-top: 72px; }
  .hero .wrap { grid-template-columns: 1.2fr .8fr; }
}

/* Home: features */
.section { padding: 24px 0; }
.section > .wrap > h2:first-child { margin-top: .6em; }
.lede { font-size: 1.1rem; color: var(--text-2); max-width: 60ch; }
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card .more { font-size: .92rem; }

/* Home: screenshots */
.shots {
  list-style: none; margin: 24px 0 0; padding: 4px 4px 16px; display: grid; gap: 16px;
  grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px);
  overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.shots li { margin: 0; scroll-snap-align: start; }
.shots figure { margin: 0; }
.shots img { border-radius: 18px; border: 4px solid var(--surface-alt); box-shadow: var(--shadow); display: block; width: 100%; }
.shots figcaption { font-size: .9rem; color: var(--text-2); margin-top: 8px; text-align: center; }
.scroll-hint { font-size: .85rem; color: var(--text-2); }

/* Home: plans */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 20px; }
.plan h3 { margin-bottom: .2em; }
.plan .status { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); background: var(--surface-alt); border-radius: var(--r-pill); padding: 2px 10px; margin-bottom: 10px; }
.plan ul { padding-left: 1.2em; margin-bottom: 0; }

.glance { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 20px; }
.glance .card h3 { font-size: 1.1rem; }

.cta { text-align: center; padding: 40px 0 8px; }
.cta p { color: var(--text-2); }

/* Document pages (legal, licenses) */
.doc { padding: 32px 0 16px; }
.doc .eyebrow { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin: 0 0 6px; }
.doc .meta { color: var(--text-2); font-size: .92rem; margin-bottom: 28px; }
.doc h2 { font-size: 1.45rem; margin: 1.8em 0 .5em; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.doc .steps { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 16px 20px 16px 40px; }
.doc .source-note { font-size: .88rem; color: var(--text-2); border-left: 3px solid var(--border); padding-left: 12px; margin-top: 2.5em; }

/* Guide: sidebar table of contents */
.guide { padding: 32px 0 16px; }
.guide-layout { display: grid; gap: 24px; }
.toc { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 4px 16px; }
.toc summary { cursor: pointer; padding: 10px 0; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.toc ol { margin: 0 0 12px; padding-left: 1.4em; font-size: .95rem; }
.toc li { padding: 3px 0; }
.toc li + li { margin-top: 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.guide-body { min-width: 0; max-width: var(--measure); }
.guide-body h2 { padding-bottom: 6px; border-bottom: 1px solid var(--rule); scroll-margin-top: 16px; }
.guide-body h2:first-of-type { margin-top: .8em; }
.guide-body h3 { scroll-margin-top: 16px; }
.guide-body .back-top { font-size: .85rem; }
@media (min-width: 960px) {
  .guide-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; }
  .toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
  .toc summary { pointer-events: none; list-style: none; }
  .toc summary::-webkit-details-marker { display: none; }
}

.note, .warn {
  border-radius: var(--r-sm); padding: 12px 16px; margin: 0 0 1em; border: 1px solid var(--rule);
  background: var(--surface);
}
.note { border-left: 4px solid var(--border); }
.warn { border-left: 4px solid var(--accent); }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }
.ui { font-weight: 600; }

table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; color: var(--text-2); }
.table-scroll { overflow-x: auto; }

dl.faq dt { font-weight: 600; margin-top: 1.2em; }
dl.faq dd { margin: .3em 0 0; }

/* Licenses */
.lic-summary { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.lic-summary li { margin: 0; }
.lic-summary a { display: inline-block; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-pill); padding: 4px 12px; text-decoration: none; font-size: .9rem; }
.pkg-list { list-style: none; padding: 0; columns: 1; column-gap: 32px; font-size: .92rem; }
@media (min-width: 760px) { .pkg-list { columns: 2; } }
.pkg-list li { break-inside: avoid; margin: 0 0 6px; }
.pkg-list .ver, .pkg-list .copy { color: var(--text-2); }
.pkg-list .copy { display: block; font-size: .82rem; }
.pkg-list .direct a { font-weight: 600; }
pre.license-text {
  white-space: pre-wrap; font-family: var(--mono); font-size: .8rem; line-height: 1.5;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 16px; max-height: 420px; overflow: auto;
}
details.license > summary { cursor: pointer; padding: 8px 0; min-height: 44px; }

/* 404 */
.notfound { text-align: center; padding: 64px 0 24px; }
.notfound img { width: 80px; height: 80px; border-radius: 18px; }

@media print {
  .site-header .site-nav, .site-footer .site-nav, .skip-link, .toc { display: none; }
  body { background: #fff; color: #000; }
}
