/* Envelopage site styles. Postal theme: paper background, stamp badges, postmark step numbers,
   envelope-flap dividers. One stylesheet for every page; the home page adds demo styles below. */
:root {
  --bg: #F7F3EC;
  --surface: #FFFFFF;
  --surface-2: #FBF8F3;
  --ink: #1C1F23;
  --muted: #5B6168;
  --line: #E6DFD3;
  --accent: #C2553A;
  --accent-ink: #FFFFFF;
  --accent-soft: #F6E6E0;
  --postmark: #3A5A8C;
  --ok: #2F7D5B;
  --radius: 14px;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 2px rgba(28, 31, 35, .06), 0 8px 24px rgba(28, 31, 35, .07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141618;
    --surface: #1C1F22;
    --surface-2: #181B1D;
    --ink: #ECEDEE;
    --muted: #A2A8AE;
    --line: #2E3236;
    --accent: #E07A5F;
    --accent-ink: #141618;
    --accent-soft: #33241F;
    --postmark: #8FB0E0;
    --ok: #6CC49B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; display: block; }
nav.top { display: flex; align-items: center; gap: 18px; }
nav.top a { color: var(--muted); text-decoration: none; font-size: .95rem; }
nav.top a:hover { color: var(--ink); }
nav.top a.btn { color: var(--accent-ink); }

/* type */
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 5.6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.08rem; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--postmark); margin: 0 0 10px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 620px; }
.note { color: var(--muted); font-size: .92rem; margin-top: 10px; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }

/* hand-drawn underline under a word in the headline */
.hand { position: relative; white-space: nowrap; }
.hand svg { position: absolute; left: -2%; bottom: -0.18em; width: 104%; height: .32em; overflow: visible; }
.hand path { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1s .4s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.06); }
.btn.small { padding: 7px 14px; font-size: .9rem; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface); filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 24px; }

/* stamps: postage-stamp badges */
.stamps { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 0; padding: 0; list-style: none; }
.stamp { position: relative; background: var(--surface); color: var(--ink); font-size: .88rem; font-weight: 600; padding: 7px 12px; border: 1.5px dashed var(--accent); border-radius: 3px; outline: 4px solid var(--surface); outline-offset: 0; box-shadow: 0 0 0 5px var(--line); }
.stamp:nth-child(2n) { transform: rotate(-1.5deg); }
.stamp:nth-child(3n) { transform: rotate(1.2deg); }

/* sections and the envelope-flap divider */
section { padding: 72px 0; position: relative; }
section.flap::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 160px; height: 22px; transform: translateX(-50%);
  background: var(--line);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 22'%3E%3Cpath d='M2 2 L80 20 L158 2' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 160px 22px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 22'%3E%3Cpath d='M2 2 L80 20 L158 2' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 160px 22px no-repeat;
}
section.flap::after { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 1px solid var(--line); z-index: -1; }
.section-head { max-width: 680px; margin-bottom: 36px; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* generic cards and grids */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-bottom: 6px; }
.card p { margin: 0; color: var(--muted); }

/* postmark step numbers */
.steps { counter-reset: step; }
.step .postmark { display: block; width: 92px; height: 48px; color: var(--postmark); margin-bottom: 10px; }
.step .postmark text { font: 700 18px var(--serif); fill: currentColor; }

/* hero */
.hero { display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr); align-items: center; padding: 40px 0 72px; }
@media (min-width: 960px) { .hero { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); } }
.works-with { margin-top: 22px; font-size: .9rem; color: var(--muted); }

/* the hero demo: a mail window, the Envelopage panel, and a Notion-style database */
.demo { position: relative; }
.win { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.win-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.win-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.win-bar span { margin-left: 8px; font-size: .78rem; color: var(--muted); }
.mail { display: grid; grid-template-columns: minmax(0, 1fr) 188px; }
.mail-body { padding: 16px 18px; min-width: 0; }
.mail-subject { font-weight: 700; font-size: 1.02rem; margin: 0 0 8px; }
.mail-from { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; background: #7A6FA8; flex: none; }
.mail-from b { color: var(--ink); font-weight: 600; }
.mail-text { font-size: .84rem; color: var(--muted); margin: 0 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.chip svg { width: 14px; height: 14px; flex: none; }
.panel { border-left: 1px solid var(--line); padding: 14px 14px 58px; background: var(--surface-2); font-size: .8rem; position: relative; }
.panel-title { display: flex; align-items: center; gap: 7px; font-weight: 700; margin-bottom: 12px; }
.panel-title img { width: 18px; height: 18px; }
.field { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: var(--surface); margin: 4px 0 10px; display: flex; justify-content: space-between; }
.panel label { color: var(--muted); font-size: .74rem; }
.check { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--ink); }
.check i { width: 13px; height: 13px; border-radius: 3px; background: var(--postmark); display: grid; place-items: center; } /* Gmail draws its own checkbox colour; we can only tint the Save button */
.check i path { stroke: var(--surface); }
.save { width: 100%; background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 8px; text-align: center; font-weight: 700; transition: transform .12s, filter .12s; }
.demo.pressed .save { transform: scale(.95); filter: brightness(.92); }
.toast { position: absolute; left: 10px; right: 10px; bottom: 10px; background: var(--ink); color: var(--bg); border-radius: 8px; padding: 7px 9px; font-size: .74rem; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.demo.saved .toast { opacity: 1; transform: none; }

.db { margin: -18px 0 0 44px; position: relative; z-index: 1; }
@media (max-width: 640px) { .db { margin: 14px 0 0; } .mail { grid-template-columns: minmax(0, 1fr); } .panel { border-left: 0; border-top: 1px solid var(--line); } }
.db-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-weight: 700; font-size: .92rem; }
.db-head small { font-weight: 500; color: var(--muted); font-size: .76rem; margin-left: auto; }
.db-table { width: 100%; border-collapse: collapse; font-size: .78rem; table-layout: fixed; }
.db-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.db-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-table th:nth-child(1) { width: 38%; }
.db-table th:nth-child(2) { width: 22%; }
.db-table th:nth-child(3) { width: 15%; }
.db-table td:first-child { font-weight: 600; }
.db-table .new td { background: var(--accent-soft); }
.db-table .new { display: none; }
.demo.row .db-table .new { display: table-row; }
.db-table .new td span { opacity: 0; transition: opacity .25s; }
.demo.row .db-table .new td span { opacity: 1; }
.demo.row .db-table .new td:nth-child(2) span { transition-delay: .25s; }
.demo.row .db-table .new td:nth-child(3) span { transition-delay: .5s; }
.demo.row .db-table .new td:nth-child(4) span { transition-delay: .75s; }
.gl { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* the envelope that flies from the panel to the database */
.flyer { position: absolute; left: 0; top: 0; width: 44px; height: 32px; z-index: 3; opacity: 0; pointer-events: none; transform: translate(var(--fx, 0), var(--fy, 0)) scale(.6); }
.demo.fly .flyer { opacity: 1; transform: translate(var(--tx, 0), var(--ty, 0)) scale(1); transition: transform .9s cubic-bezier(.5, -0.2, .3, 1.2), opacity .2s; }
.demo.row .flyer { opacity: 0; transition: opacity .2s; }
.cursor { position: absolute; left: 0; top: 0; width: 20px; height: 20px; z-index: 4; pointer-events: none; transform: translate(var(--cx0, 0), var(--cy0, 0)); transition: transform .8s ease-in-out; opacity: 0; }
.demo.aim .cursor { opacity: 1; transform: translate(var(--cx, 0), var(--cy, 0)); }
.demo.row .cursor { opacity: 0; transition: opacity .4s; }
.demo-caption { font-size: .82rem; color: var(--muted); margin: 14px 0 0 44px; }
@media (max-width: 640px) { .demo-caption { margin-left: 0; } }

/* use-case tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tabs button { font: inherit; font-size: .92rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.case { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 820px) { .case { grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); } }
.case[hidden] { display: none; }
.arrow { display: grid; place-items: center; color: var(--accent); }
.arrow svg { width: 40px; height: 40px; }
@media (max-width: 819px) { .arrow svg { transform: rotate(90deg); } }
.page { padding: 18px 20px; }
.page-db { font-size: .76rem; color: var(--muted); margin-bottom: 6px; }
.page h3 { font-family: var(--serif); font-size: 1.35rem; margin-bottom: 12px; }
.props { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 7px 10px; font-size: .84rem; margin: 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.props .empty { color: var(--muted); opacity: .7; }
.auto { font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ok); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; }
.page-body { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); }

/* anatomy: numbered pins on the email, matching parts of the Notion page */
.anatomy { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .anatomy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.pin { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--postmark); color: var(--surface); font-size: .72rem; font-weight: 700; flex: none; cursor: default; transition: transform .15s; }
[data-k] { border-radius: 6px; transition: background .15s, box-shadow .15s; }
[data-k].hl { background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); }
[data-k].hl .pin { transform: scale(1.15); background: var(--accent); }
.part { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.legend { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.legend li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--muted); padding: 6px; }
.legend b { color: var(--ink); }

/* privacy path */
.path { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: center; margin-bottom: 28px; }
@media (min-width: 820px) { .path { grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1.1fr) 90px minmax(0, 1fr); } }
.node { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.node b { display: block; }
.node small { color: var(--muted); }
.node.mid { border: 2px solid var(--accent); }
.wire { height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 18px); background-size: 18px 6px; animation: flow 1s linear infinite; }
@media (max-width: 819px) { .wire { height: 34px; width: 6px; margin: 0 auto; background: repeating-linear-gradient(180deg, var(--accent) 0 8px, transparent 8px 18px); background-size: 6px 18px; animation-name: flowv; } }
@keyframes flow { to { background-position: 18px 0; } }
@keyframes flowv { to { background-position: 0 18px; } }
.side-wire { display: flex; align-items: center; gap: 12px; justify-content: center; font-size: .88rem; color: var(--muted); margin: -8px 0 28px; flex-wrap: wrap; }
.side-wire .node { padding: 10px 14px; }
.side-wire i { width: 40px; border-top: 2px dashed var(--line); }
.seen { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.seen ul { margin: 10px 0 0; padding: 0; list-style: none; }
.seen li { padding: 6px 0 6px 28px; position: relative; color: var(--muted); }
.seen li::before { position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; }
.seen .yes li::before { content: "✓"; background: var(--accent-soft); color: var(--accent); }
.seen .no li::before { content: "✕"; background: var(--line); color: var(--muted); }

/* pricing */
.billing { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); margin-bottom: 22px; }
.billing button { font: inherit; font-size: .9rem; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.billing button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.billing em { font-style: normal; color: var(--ok); font-size: .8rem; margin-left: 4px; }
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); max-width: 760px; }
.plan { position: relative; }
.plan.featured { border: 2px solid var(--accent); }
.plan .price { font: 600 2.6rem/1 var(--serif); margin: 8px 0 4px; }
.plan .price small { font: 500 1rem var(--sans); color: var(--muted); }
.plan ul { padding-left: 0; list-style: none; margin: 16px 0 18px; }
.plan li { padding: 4px 0 4px 24px; position: relative; color: var(--muted); }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.plan .btn { width: 100%; justify-content: center; }
.plan .fine { font-size: .82rem; color: var(--muted); margin: 10px 0 0; text-align: center; }
.plan .tag { position: absolute; top: -12px; right: 16px; background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }

/* the maker's note, as a postcard */
.postcard { position: relative; max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 34px 34px 30px; box-shadow: var(--shadow); background-image: repeating-linear-gradient(135deg, var(--accent) 0 10px, transparent 10px 20px, var(--postmark) 20px 30px, transparent 30px 40px); background-size: 100% 6px; background-repeat: no-repeat; }
.postcard p { font-family: var(--serif); font-size: 1.12rem; line-height: 1.65; margin: 0 0 14px; max-width: 560px; }
.postcard .sign { font-style: italic; color: var(--muted); }
.postcard .pc-stamp { position: absolute; top: 26px; right: 28px; width: 64px; height: 76px; }
@media (max-width: 560px) { .postcard { padding: 28px 20px 22px; } .postcard .pc-stamp { width: 48px; height: 57px; top: 18px; right: 16px; } .postcard p:first-of-type { margin-right: 52px; } }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; max-width: 820px; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 10px 0 0; }

/* closing band */
.closing { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 48px 20px; }
.closing .actions { justify-content: center; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: .9rem; margin-top: 72px; }
footer a { color: var(--muted); }

/* privacy and terms pages */
.legal { max-width: 760px; padding: 24px 0 48px; }
.legal h1 { font-size: 2.2rem; }
.legal h2 { font-size: 1.35rem; margin-top: 1.6em; }
.legal table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal code { font-size: .85em; word-break: break-all; }

@media (max-width: 720px) { nav.top a:not(.btn) { display: none; } section { padding: 56px 0; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hand path { animation: none; stroke-dashoffset: 0; }
  .wire { animation: none; }
  * { transition: none !important; }
}
