/* DMO Sign public pages in the "Paper Trail" look (same tokens and type as paper.css, the home page):
   pricing (billing.js), API (api-plans.js), security (dmosign-trust.js), templates, template pages, blog and 404
   (built by src/site/index.js). Everything is scoped to .pt-pg, so the signed-in app's screens keep their own look.
   Motion only under html.dsl-motion or prefers-reduced-motion: no-preference. */

/* ---------- page head ---------- */
.pt-pg { padding-bottom: clamp(2rem, 1rem + 3vw, 4rem); }
.pt-ph { padding: clamp(2.5rem, 1.5rem + 4vw, 5.5rem) 0 clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.pt-ph.pt-ph-split h1 { font-size: clamp(2.4rem, 1.4rem + 3.2vw, 4.2rem); }
.pt-ph h1 { font: 380 clamp(2.6rem, 1.5rem + 4vw, 5rem)/1 var(--font-display); letter-spacing: -.035em; margin: 0 0 1.4rem; text-wrap: balance; max-width: 16ch; }
.pt-ph .pt-sub { margin-bottom: 0; }
.pt-ph-center { text-align: center; display: grid; justify-items: center; }
.pt-ph-center h1 { max-width: 20ch; }
.pt-ph-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 5vw, 5.5rem); align-items: center; }
.pt-ph-text { min-width: 0; }
.pt-ph-text .pt-actions { margin-top: 2rem; }
.pt-pg .pt-hint { margin: 1.2rem 0 0; color: var(--muted); font-size: .95rem; }
.pt-pg .ds-crumbs { margin: 1.5rem 0 0; }

.pt-band { padding-block: clamp(3rem, 2rem + 4vw, 6rem); border-top: 1px solid var(--line); }
.pt-band > .pt-h2 { margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.8rem); }
.pt-narrow > * { max-width: 46rem; }
.pt-note { max-width: 46rem; margin: 0 auto 1rem; padding: 1rem 1.25rem 1rem 3rem; position: relative; color: var(--muted); font-size: .95rem; line-height: 1.6; border-radius: 12px; background: color-mix(in srgb, var(--brand-soft) 55%, transparent); }
.pt-note::before { content: "i"; position: absolute; left: 1.1rem; top: 1rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 1.5px solid var(--brand); color: var(--brand); font: 700 .75rem/1.05rem var(--font-display); text-align: center; }
.pt-updated { margin-top: 2.5rem; }

/* numbered trio (API steps, how to send a template) */
.pt-trio { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3.5rem); counter-reset: none; }
.pt-trio li { min-width: 0; border-top: 1.5px solid var(--ink); padding-top: 1.4rem; }
.pt-trio .pt-num { font: 300 clamp(3.4rem, 2.4rem + 3vw, 5.2rem)/.8 var(--font-display); color: color-mix(in srgb, var(--brand) 30%, var(--bg)); letter-spacing: -.04em; margin: 0 0 1.2rem; }
.pt-trio h3 { font: 430 clamp(1.3rem, 1.1rem + .6vw, 1.6rem)/1.15 var(--font-display); letter-spacing: -.015em; margin: 0 0 .6rem; }
.pt-trio p:not(.pt-num) { color: var(--muted); line-height: 1.65; margin: 0; }

/* sheets of paper (security points, template notes) */
.pt-sheets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.75rem); counter-reset: sheet; }
.pt-sheet, .pt-pg-trust .ds-trust-section { background: var(--surface); border: 0; border-radius: 10px; padding: clamp(1.4rem, 1rem + 1.5vw, 2.2rem); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 24px 48px -32px rgba(31,22,64,.35), 0 0 0 1px rgba(31,22,64,.06); max-width: none; }
.pt-sheet h3 { font: 430 1.3rem/1.2 var(--font-display); margin: 0 0 .6rem; letter-spacing: -.01em; }
.pt-sheet p { margin: 0; color: var(--muted); line-height: 1.65; }

/* ---------- closing call to action on these pages ---------- */
.pt-pg .pt-cta, .pt-cta-static { border-top: 1px solid var(--line) !important; margin-top: clamp(2rem, 1rem + 3vw, 4rem); }

/* ---------- pricing ---------- */
.pt-pg-pricing .bill-toggle { margin: 0 auto 2.2rem; display: flex; width: max-content; }
.pt-pg-pricing > .notice { max-width: 52rem; margin-inline: auto; }
.pt-pg-pricing .plan-grid { max-width: 56rem; margin: 0 auto; gap: clamp(1rem, 2.5vw, 2rem); }
.pt-pg .plan-card { background: #fffefb; border: 0; border-radius: 12px; padding: clamp(1.5rem, 1rem + 1.6vw, 2.4rem); box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 34px 60px -38px rgba(31,22,64,.42), 0 0 0 1px rgba(31,22,64,.07); }
.pt-pg .plan-card.plan-suggested { box-shadow: 0 0 0 2px var(--brand), 0 40px 70px -36px rgba(84,47,156,.5); position: relative; }
.pt-pg .plan-name { font: 420 clamp(1.6rem, 1.3rem + .8vw, 2rem)/1.1 var(--font-display); letter-spacing: -.02em; }
.pt-pg .plan-amount { font: 340 clamp(3rem, 2.2rem + 2.4vw, 4.2rem)/1 var(--font-display); letter-spacing: -.04em; }
.pt-pg .plan-list li::marker { color: #2f9a5c; }
.pt-pg-pricing .plan-api { margin-top: clamp(4rem, 3rem + 4vw, 7rem); padding-top: clamp(3rem, 2rem + 3vw, 5rem); border-top: 1px solid var(--line); }
.pt-pg .plan-api > h2, .pt-pg-pricing .plan-rules > h2, .pt-pg-pricing .plan-included > h2 { font: 360 clamp(2rem, 1.3rem + 2.4vw, 3.2rem)/1.04 var(--font-display); letter-spacing: -.025em; margin: 0 0 .9rem; }
.pt-pg .plan-api > .lead { color: var(--muted); max-width: 40rem; }
.pt-pg .api-plan-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; }
.pt-pg .api-plan-grid .plan-card { padding: 1.5rem; }
.pt-pg .api-plan-grid .plan-amount { font-size: clamp(2.3rem, 1.8rem + 1.2vw, 3rem); }
.pt-pg-pricing .plan-notes { max-width: 56rem; margin: 1.5rem auto 0; text-align: center; }
.pt-pg-pricing .plan-rules { margin-top: clamp(4rem, 3rem + 4vw, 7rem); padding-top: clamp(3rem, 2rem + 3vw, 5rem); border-top: 1px solid var(--line); }
.pt-pg-pricing .plan-rules dl, .pt-pg-pricing .plan-rules .plan-rule-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem clamp(2rem, 4vw, 4rem); }
.pt-pg-pricing .plan-rules h3 { font: 430 1.25rem/1.25 var(--font-display); letter-spacing: -.01em; }
.pt-pg-pricing .plan-rules p { color: var(--muted); line-height: 1.65; }
.pt-pg-pricing .plan-included { margin-top: clamp(3rem, 2rem + 3vw, 5rem); background: var(--surface); border-radius: 14px; padding: clamp(1.6rem, 1rem + 2vw, 3rem); box-shadow: 0 30px 60px -44px rgba(31,22,64,.4), 0 0 0 1px rgba(31,22,64,.06); }
.pt-pg-pricing .plan-included .plan-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 2.5rem; }
.pt-pg-pricing .plan-included .plan-list li { position: relative; padding-left: 2rem; line-height: 1.55; }
.pt-pg-pricing .plan-included .plan-list li::before, .pt-pg-trust .ds-trust-list li::before { content: ""; position: absolute; left: 0; top: .42rem; width: .95rem; height: .5rem; border-left: 2.5px solid #2f9a5c; border-bottom: 2.5px solid #2f9a5c; transform: rotate(-45deg); }

/* ---------- API ---------- */
.pt-code { margin: 0; min-width: 0; border-radius: 14px; background: #1f1640; color: #e9e3f7; box-shadow: 0 50px 90px -46px rgba(31,22,64,.75), 0 0 0 1px rgba(31,22,64,.2); overflow: hidden; transform: rotate(-.8deg); }
.pt-code-bar { display: flex; align-items: center; gap: .45rem; padding: .85rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.pt-code-bar span { width: .7rem; height: .7rem; border-radius: 50%; background: rgba(255,255,255,.18); }
.pt-code-bar em { margin-left: auto; font: 600 .75rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; font-style: normal; color: #c4b2f2; letter-spacing: .04em; }
.pt-code pre { margin: 0; padding: 1.3rem 1.3rem 1rem; overflow-x: auto; font: .84rem/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: none; color: inherit; border: 0; }
.pt-code code { background: none; padding: 0; color: inherit; font: inherit; }
.pt-c-line { display: block; white-space: pre; }
.pt-c-k { color: #ffd66b; }
.pt-c-s { color: #b9e4c9; }
.pt-code-out { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.3rem 1.3rem; }
.pt-code-ev { font: 600 .74rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: .45rem .7rem; border-radius: 999px; background: rgba(255,255,255,.08); color: #d8cff0; }
.pt-code-ev::before { content: "webhook  "; color: #9a8fbf; white-space: pre; }
.pt-code-done { background: #e3f2e7; color: #1c6b3a; }
.pt-code-done::before { color: #2f9a5c; }
.dsl-motion .pt-code pre { clip-path: inset(0 0 100% 0); }
.dsl-motion .pt-code .pt-code-ev { opacity: 0; transform: translateY(4px); }
.dsl-motion .pt-code.is-run pre { animation: pt-type 1.6s steps(19, end) .2s both; }
.dsl-motion .pt-code.is-run .pt-code-ev { animation: pt-line .35s ease both; }
.dsl-motion .pt-code.is-run .pt-code-ev:nth-child(1) { animation-delay: 2s; }
.dsl-motion .pt-code.is-run .pt-code-ev:nth-child(2) { animation-delay: 2.6s; }
.dsl-motion .pt-code.is-run .pt-code-ev:nth-child(3) { animation-delay: 3.2s; animation-name: pt-line-pop; }
@keyframes pt-type { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes pt-line { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pt-line-pop { 0% { opacity: 0; transform: scale(.8); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
.pt-pg-api .plan-api > h2 { margin-top: 0; }

/* ---------- security ---------- */
.pt-sec-papers { max-width: 34rem; justify-self: end; width: 100%; }
.pt-pg-trust .pt-sheets { padding-top: clamp(1rem, .5rem + 2vw, 2.5rem); }
.pt-pg-trust .ds-trust-section { counter-increment: sheet; position: relative; }
.pt-pg-trust .ds-trust-section h2 { font: 430 clamp(1.35rem, 1.15rem + .6vw, 1.65rem)/1.15 var(--font-display); letter-spacing: -.015em; margin: 0 0 1rem; padding-right: 3rem; }
.pt-pg-trust .ds-trust-section::after { content: counter(sheet, decimal-leading-zero); position: absolute; top: clamp(1.2rem, .9rem + 1.4vw, 2rem); right: clamp(1.4rem, 1rem + 1.5vw, 2.2rem); font: 300 1.5rem/1 var(--font-display); color: color-mix(in srgb, var(--brand) 32%, var(--bg)); }
.pt-pg-trust .ds-trust-list { list-style: none; padding: 0; gap: .8rem; }
.pt-pg-trust .ds-trust-list li { position: relative; padding-left: 1.9rem; color: var(--ink); line-height: 1.6; }
.pt-pg-trust .ds-trust-section.ds-trust-not { background: transparent; box-shadow: none; border: 1.5px dashed var(--brand-line); counter-increment: none; }
.pt-pg-trust .ds-trust-not::after { content: none; }
.pt-pg-trust .ds-trust-not p { color: var(--muted); max-width: 52rem; line-height: 1.65; }

/* ---------- templates ---------- */
.pt-pg-templates .pt-note { margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.pt-tpl-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: clamp(2rem, 1.5rem + 2vw, 3.5rem) clamp(1.25rem, 1rem + 1.5vw, 2.5rem); }
.pt-tpl-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pt-tpl-card a { display: grid; gap: .55rem; text-decoration: none; color: var(--ink); }
.pt-tpl-card .pt-book-page { aspect-ratio: 8.5 / 11; }
.pt-tpl-card .pt-book-page img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pt-tpl-card a:hover .pt-book-page, .pt-tpl-card a:focus-visible .pt-book-page { transform: translateY(-8px) rotate(-1deg); box-shadow: 0 34px 50px -26px rgba(31,22,64,.5), 0 0 0 1px rgba(31,22,64,.08); }
.pt-tpl-name { font: 450 1.2rem/1.25 var(--font-display); letter-spacing: -.01em; }
.pt-tpl-card a:hover .pt-tpl-name { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.pt-tpl-desc { color: var(--muted); line-height: 1.55; font-size: .97rem; }
.pt-tpl-meta { color: var(--muted); font-size: .86rem; }

.pt-ph-doc { padding-top: clamp(1.5rem, 1rem + 2vw, 3rem); }
.pt-ph.pt-ph-doc h1 { font-size: clamp(2.4rem, 1.5rem + 3.4vw, 4.4rem); }
.pt-facts { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 2rem; max-width: 34rem; }
.pt-facts li { border-top: 1px solid var(--line-strong, var(--line)); padding-top: .7rem; line-height: 1.45; }
.pt-facts span { display: block; font: 650 .7rem/1 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: .45rem; }
.pt-tpl-sheet { margin: 0; justify-self: center; width: min(100%, 26rem); }
.pt-tpl-sheet img { display: block; width: 100%; height: auto; background: #fff; border-radius: 5px; box-shadow: var(--paper-shadow), 0 0 0 1px rgba(31,22,64,.07); transform: rotate(1.4deg); }
@media (prefers-reduced-motion: no-preference) {
  .pt-tpl-sheet img { animation: pt-sheet-in .9s cubic-bezier(.2,.8,.2,1) both .1s; }
  @keyframes pt-sheet-in { from { opacity: 0; transform: translateY(30px) rotate(4deg); } to { opacity: 1; transform: rotate(1.4deg); } }
}

/* ---------- blog ---------- */
.pt-posts { list-style: none; margin: 0 auto; padding: 0; max-width: 52rem; display: grid; }
.pt-post a { display: grid; gap: .5rem; padding: 2rem 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pt-post-date { font: 650 .72rem/1 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.pt-post-title { font: 400 clamp(1.6rem, 1.3rem + 1vw, 2.2rem)/1.1 var(--font-display); letter-spacing: -.02em; }
.pt-post-desc { color: var(--muted); line-height: 1.6; max-width: 42rem; }
.pt-post-more { color: var(--brand); font-weight: 600; font-size: .95rem; }
.pt-post a:hover .pt-post-title { color: var(--brand); }
.pt-empty { text-align: center; color: var(--muted); font: 400 1.6rem/1.3 var(--font-display); font-style: italic; margin: 0 auto; padding: 2rem 0 1rem; }
.pt-article { margin: 0 auto; max-width: 44rem; padding-top: clamp(2rem, 1rem + 3vw, 4rem); }
.pt-article h1 { font: 380 clamp(2.4rem, 1.5rem + 3.4vw, 4rem)/1.03 var(--font-display); letter-spacing: -.03em; margin: 0 0 1rem; text-wrap: balance; }
.pt-article h2 { font: 420 clamp(1.5rem, 1.25rem + .8vw, 2rem)/1.15 var(--font-display); letter-spacing: -.015em; margin: 2.8rem 0 .8rem; }
.pt-article h3 { font: 450 1.3rem/1.2 var(--font-display); margin: 2rem 0 .5rem; }
.pt-article p, .pt-article li { font-size: 1.12rem; line-height: 1.75; }
.pt-article .ds-blog-meta { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.pt-article-more { max-width: 44rem; margin: 3rem auto 0; }

/* ---------- 404 ---------- */
.pt-pg-404 { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-block: clamp(3rem, 2rem + 5vw, 7rem); }
.pt-404-sheet { position: relative; display: grid; gap: 1rem; align-content: start; aspect-ratio: 8.5 / 11; background: #fff; border-radius: 6px; padding: 12% 12%; box-shadow: var(--paper-shadow), 0 0 0 1px rgba(31,22,64,.06); transform: rotate(-2deg); max-width: 22rem; }
.pt-404-n { font: 300 clamp(4rem, 3rem + 4vw, 6.5rem)/1 var(--font-display); color: var(--brand); letter-spacing: -.04em; margin-bottom: 1rem; }
.pt-404-line { height: .5rem; border-radius: 4px; background: #efeaf6; }
.pt-404-short { width: 60%; }
.pt-404-sig { position: absolute; left: 12%; right: 12%; bottom: 12%; border-top: 1.5px solid var(--line-strong, #cfc6dc); padding-top: .5rem; font: 650 .7rem/1 var(--font-text); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pt-404-text h1 { font: 380 clamp(2.4rem, 1.5rem + 3.4vw, 4.2rem)/1.02 var(--font-display); letter-spacing: -.03em; margin: 0 0 1.2rem; text-wrap: balance; }
.pt-404-text .pt-actions { margin-top: 2rem; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .pt-pg .api-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pt-ph-split, .pt-pg-404 { grid-template-columns: minmax(0, 1fr); }
  .pt-sec-papers { justify-self: center; }
  .pt-trio, .pt-sheets, .pt-tpl-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .pt-pg-pricing .plan-rules dl, .pt-pg-pricing .plan-rules .plan-rule-list, .pt-pg-pricing .plan-included .plan-list { grid-template-columns: minmax(0, 1fr); }
  .pt-tpl-sheet { width: min(100%, 22rem); }
  .pt-404-sheet { max-width: 14rem; justify-self: center; }
  .pt-code { transform: none; }
}
@media (max-width: 640px) {
  .pt-pg .api-plan-grid, .pt-pg-pricing .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .pt-facts { grid-template-columns: minmax(0, 1fr); }
  .pt-pg .pt-actions .btn { flex: 1 1 100%; }
  .pt-code pre { font-size: .74rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pt-tpl-card .pt-book-page { transition: none; }
}
.pt-pg-pricing .plan-rules { max-width: none; }
.pt-pg-pricing .plan-rules h3 { margin: 0 0 .45rem; }

/* Server-built pages: beat site.css's main[data-page-kind="static"] heading rules. */
main .pt-pg .pt-h2, main .pt-pg h1 { margin-top: 0; }
main .pt-pg .pt-trio h3 { font: 430 clamp(1.3rem, 1.1rem + .6vw, 1.6rem)/1.15 var(--font-display); letter-spacing: -.015em; margin: 0 0 .6rem; }
main .pt-pg .pt-sheet h3 { font: 430 1.3rem/1.2 var(--font-display); letter-spacing: -.01em; margin: 0 0 .6rem; }
main .pt-pg .pt-article h2 { margin-top: 2.8rem; }
@media (max-width: 1180px) { .pt-code pre { font-size: .74rem; } }
@media (max-width: 480px) { .pt-code pre { font-size: .64rem; padding-inline: 1rem; } }
