/* Peri web: shared styles for the landing page, guides and printables. */
:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --blush: #f4e6df;
  --line: #eadfd6;
  --ink: #2e2328;
  --ink2: #625258;
  --brand: #c17a5b;
  --brand-strong: #96492e;
  --brand-hover: #7d3b24;
  --sage: #4f7a5c;
  --sage-soft: #e5eee7;
  --plum: #7b4f74;
  --focus: #1f6feb;
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1416;
    --surface: #241c1f;
    --blush: #2e2226;
    --line: #3a2d32;
    --ink: #f1e9e6;
    --ink2: #c3b4b8;
    --brand: #e09a7a;
    --brand-strong: #f0b394;
    --brand-hover: #f7c9b0;
    --sage: #9cc6a8;
    --sage-soft: #23302a;
    --plum: #d2a8cb;
    --focus: #8ab4ff;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 10; border-radius: 8px; }
.skip:focus { left: 8px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.site-header .container { display: flex; align-items: center; gap: 18px; min-height: 68px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 20px; letter-spacing: -.01em; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 12px; border-radius: 10px; }
.site-nav a:hover { background: var(--blush); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--blush); }
.nav-cta { background: var(--brand-strong); color: #fff; text-decoration: none; font-weight: 700; font-size: 15px; padding: 10px 16px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center; }
.nav-cta:hover { background: var(--brand-hover); color: #fff; }
@media (prefers-color-scheme: dark) { .nav-cta, .nav-cta:hover { color: #1a1416; } }
@media (max-width: 680px) {
  .site-header .container { gap: 4px 12px; }
  .nav-cta { margin-left: auto; }
  .site-nav { order: 3; margin: 0 -10px; width: calc(100% + 20px); gap: 0; }
  .site-nav a { padding: 8px 10px; font-size: 15px; }
}

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 650; letter-spacing: -.015em; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(32px, 6.2vw, 54px); margin: 0 0 14px; }
h2 { font-size: clamp(26px, 4vw, 34px); margin: 56px 0 14px; }
h3 { font-size: 21px; margin: 30px 0 8px; }
p { margin: 0 0 16px; }
.lede { font-size: clamp(18px, 2.4vw, 21px); color: var(--ink2); max-width: 36em; }
.muted { color: var(--ink2); }
.small { font-size: 14px; }
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-strong); margin: 0 0 12px; }
ul, ol { padding-left: 1.3em; margin: 0 0 18px; }
li { margin: 6px 0; }
strong { font-weight: 700; }

/* Buttons and store links */
.store-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 26px 0 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 16px; text-decoration: none; line-height: 1.2; border: 2px solid transparent; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--brand-strong); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--brand); color: var(--ink); }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #1a1416; } }
.btn small { display: block; font-weight: 600; font-size: 12px; opacity: .85; }
.fineprint { font-size: 14px; color: var(--ink2); margin: 0; }
@media (max-width: 420px) { .store-row .btn { flex: 1 1 100%; } }

/* Hero */
.hero { padding: 56px 0 24px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; }
.hero-shot { justify-self: center; width: min(100%, 340px); }
@media (max-width: 860px) {
  .hero { padding-top: 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero .store-row { margin: 20px 0 10px; }
  .hero-shot { width: min(72%, 280px); }
}

/* App screenshot frame: real app pixels inside a simple rounded screen edge. */
.shot { margin: 0; }
.shot .screen { border-radius: 26px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 18px 40px -22px rgba(74, 40, 28, .35); background: #faf6f1; }
.shot figcaption { font-size: 13px; color: var(--ink2); margin-top: 10px; text-align: center; }

/* Cards and grids */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.path-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.path-card:hover { border-color: var(--brand); color: var(--ink); transform: translateY(-2px); }
.path-card h3 { margin: 6px 0 0; font-size: 22px; }
.path-card p { color: var(--ink2); margin: 0; }
.path-card .go { margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--brand-strong); }
.icon-dot { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--blush); color: var(--brand-strong); }
.icon-dot svg { width: 24px; height: 24px; }

/* Feature rows with real screenshots */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 48px; align-items: center; padding: 30px 0; }
.feature + .feature { border-top: 1px solid var(--line); }
.feature h3 { margin-top: 0; font-size: 26px; }
.feature.flip { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
.feature.flip .shot { order: -1; }
@media (max-width: 760px) {
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 22px; }
  .feature .shot, .feature.flip .shot { order: 0; width: min(78%, 300px); justify-self: center; }
}
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 30px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 16px; height: 16px; border-radius: 50%; background: var(--sage-soft); box-shadow: inset 0 0 0 2px var(--sage); }
.checks li::after { content: ""; position: absolute; left: 7px; top: calc(.45em + 4px); width: 5px; height: 8px; border: solid var(--sage); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Pricing */
.price { font-family: var(--serif); font-size: 34px; font-weight: 650; margin: 4px 0 2px; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--sage-soft); color: var(--sage); }
.badge.premium { background: var(--blush); color: var(--brand-strong); }

/* Panels */
.band { background: var(--blush); border-radius: 24px; padding: 34px; margin: 56px 0 0; }
.band h2 { margin-top: 0; }
.note { border-left: 4px solid var(--sage); background: var(--sage-soft); padding: 16px 20px; border-radius: 0 12px 12px 0; margin: 22px 0; }
.note p:last-child { margin-bottom: 0; }
.warn { border-left-color: var(--brand); background: var(--blush); }

/* Article layout */
.breadcrumb { font-size: 14px; color: var(--ink2); margin: 28px 0 18px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.breadcrumb a { color: var(--ink2); }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
.article { max-width: 700px; }
.article h2 { font-size: clamp(25px, 3.4vw, 30px); margin-top: 46px; scroll-margin-top: 20px; }
.meta { font-size: 14px; color: var(--ink2); margin: -4px 0 26px; }
.aside { position: sticky; top: 24px; display: grid; gap: 16px; }
.toc h2 { font-family: var(--sans); font-size: 14px; letter-spacing: .05em; text-transform: uppercase; margin: 0 0 8px; color: var(--ink2); }
.toc ol { padding-left: 1.1em; margin: 0; font-size: 15px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--brand-strong); text-decoration: underline; }
.app-card h2 { font-size: 22px; margin: 0 0 6px; }
.app-card p { font-size: 15px; color: var(--ink2); }
.app-card .btn { width: 100%; min-height: 48px; font-size: 15px; margin-top: 8px; }
@media (max-width: 980px) {
  .article-grid { grid-template-columns: 1fr; gap: 0; }
  .aside { position: static; }
  .aside .toc { display: none; }
}
.mobile-toc { display: none; margin: 0 0 24px; }
@media (max-width: 980px) { .mobile-toc { display: block; } }
.mobile-toc summary { cursor: pointer; font-weight: 700; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 48px; display: flex; align-items: center; }
.mobile-toc ol { margin: 10px 0 0; padding-left: 2.2em; }
.mobile-toc a { color: var(--ink); }

.sources { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 15px; }
.sources h2 { font-size: 22px; margin-top: 0; }
.sources ol { padding-left: 1.4em; }
.sources li { margin: 10px 0; }
sup.cite { font-size: 12px; line-height: 0; margin-left: 2px; }
sup.cite a { text-decoration: none; font-weight: 700; padding: 0 2px; }

table.simple { width: 100%; border-collapse: collapse; margin: 10px 0 22px; font-size: 16px; background: var(--surface); border-radius: 12px; overflow: hidden; }
table.simple th, table.simple td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.simple th { background: var(--blush); font-size: 14px; }
.table-scroll { overflow-x: auto; }

/* Footer */
.get-app { margin-top: 72px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 44px 0; }
.get-app-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.get-app img { width: 72px; height: 72px; border-radius: 17px; }
.get-app h2 { margin: 0 0 4px; font-size: 28px; }
.get-app .store-row { margin: 16px 0 8px; }
@media (max-width: 560px) { .get-app-inner { grid-template-columns: 1fr; } }
.site-footer { padding: 36px 0 52px; font-size: 14px; color: var(--ink2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 4px; margin-bottom: 16px; padding: 0; list-style: none; }
.footer-links li { margin: 0; }
.footer-links a { color: var(--ink); display: inline-block; padding: 8px 10px; margin-left: -10px; margin-right: 6px; }

/* Printable tools */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 24px 0; }
.tool fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.tool legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 15px; background: var(--bg); }
.chip input:checked + span { background: var(--blush); border-color: var(--brand); font-weight: 650; }
.chip input:checked + span::before { content: "✓"; margin-right: 6px; color: var(--brand-strong); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 650; }
.field input, .field select, .field textarea { font: inherit; font-size: 16px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); min-height: 46px; width: 100%; }
.field textarea { min-height: 84px; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.hint { font-size: 14px; color: var(--ink2); }
.preview-label { font-weight: 700; margin: 26px 0 10px; }
.preview { overflow-x: auto; border: 1px dashed var(--line); border-radius: 12px; padding: 14px; background: #fff; color: #222; color-scheme: light; }

/* The printed sheet (screen preview + print) */
.sheet { font: 11px/1.35 var(--sans); color: #222; min-width: 640px; }
.sheet h2 { font-family: var(--sans); font-size: 16px; margin: 0 0 2px; color: #222; letter-spacing: 0; }
.sheet .sheet-sub { font-size: 10.5px; color: #555; margin: 0 0 8px; }
.sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet th, .sheet td { border: 1px solid #9a8f8a; padding: 3px 4px; height: 22px; text-align: center; font-weight: 400; }
.sheet th { background: #f3ebe6; font-weight: 700; font-size: 10px; }
.sheet th.row-label, .sheet td.row-label { text-align: left; width: 132px; font-weight: 600; }
.sheet .notes-lines td { height: 26px; text-align: left; }
.sheet table.roomy td { height: 26px; }
.sheet .legend { font-size: 10px; color: #444; margin: 6px 0 8px; }
.sheet .sheet-foot { font-size: 9px; color: #666; margin-top: 8px; }
.sheet .stamp { float: right; border: 1.5px solid #96492e; color: #96492e; font-weight: 800; letter-spacing: .12em; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.sheet .page + .page { margin-top: 28px; }
.sheet .kv { display: grid; grid-template-columns: 300px 1fr; border: 1px solid #9a8f8a; border-bottom: 0; }
.sheet .kv div { padding: 5px 7px; border-bottom: 1px solid #9a8f8a; min-height: 26px; }
.sheet .kv div:nth-child(odd) { background: #f3ebe6; font-weight: 600; }
.sheet .section-title { font-weight: 700; font-size: 12px; margin: 12px 0 4px; }
.sheet .write { white-space: pre-wrap; }

@page { size: A4 landscape; margin: 10mm; }
@page portrait-sheet { size: A4 portrait; margin: 12mm; }
@media print {
  html, body { background: #fff !important; color: #000; }
  /* Keep only the printable sheet and the elements that contain it. */
  body *:not(:has(.sheet)):not(.sheet):not(.sheet *) { display: none !important; }
  body :has(.sheet) { margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; max-width: none !important; box-shadow: none !important; display: block !important; overflow: visible !important; }
  .sheet { min-width: 0; }
  .sheet.portrait .page { page: portrait-sheet; }
  .sheet .page { break-after: page; }
  .sheet .page:last-child { break-after: auto; }
  .sheet .page + .page { margin-top: 0; }
  .sheet tr { break-inside: avoid; }
}
