/* The paper receipt and the pages it travels to: the public share page and the owner page.
   Tokens and type match the home (composer.css) so a receipt looks the same wherever it prints. */

:root {
    color-scheme: dark;
    --ground: #121010;
    --surface: #1b1816;
    --surface-2: #24201d;
    --line: #302a26;
    --line-2: #453c36;
    --ink: #f2ece4;
    --muted: #9c9189;
    --faint: #6f665f;
    --amber: #f4a340;
    --amber-soft: #3a2a17;
    --warn: #ffcf66;
    --paper: #f4efe6;
    --paper-ink: #1f1b18;
    --paper-muted: #7a716a;
    --paper-line: #d9d0c3;
    --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
    --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
    --touch: 44px;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }

body.rp {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.5;
    padding-inline: max(16px, env(safe-area-inset-left, 0px));
    padding-block: 14px 28px;
    -webkit-text-size-adjust: 100%;
    overflow-wrap: break-word;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a { color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible,
a:focus-visible,
input:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.rp-app { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* Top bar */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mark { letter-spacing: .42em; font-size: 14px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; min-height: var(--touch); }
.pill { font-family: var(--mono); font-size: 11px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; text-align: right; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); flex: none; }

/* Page grid: one column on phones; from 960px the receipt holds the right column */
.rp-layout { display: flex; flex-direction: column; gap: 18px; }
.rp-layout > * { min-width: 0; }

h1 {
    font-family: var(--display);
    font-weight: 750;
    font-size: 32px;
    line-height: 1.04;
    letter-spacing: -.02em;
    margin: 4px 0 0;
    text-wrap: balance;
}
h1 em {
    font-style: normal;
    color: var(--amber);
    background: linear-gradient(var(--amber), var(--amber)) 0 100% / 100% 3px no-repeat;
    padding-bottom: 1px;
}
h1 .n { color: var(--amber); }
.lede { font-size: 14px; color: var(--muted); margin: 8px 0 0; max-width: 52ch; }

h2 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -.01em;
    margin: 0 0 4px;
}
.sub { font-size: 13px; color: var(--muted); margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }

/* The paper receipt */
.rp-receipt { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.receipt {
    width: 100%;
    max-width: 400px;
    background: var(--paper);
    color: var(--paper-ink);
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.55;
    padding: 18px 18px 22px;
    margin: 0;
    position: relative;
    animation: print 1.1s cubic-bezier(.2, .8, .3, 1) both;
    -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 5.5px, #000 6px) 0 100% / 14px 100% repeat-x;
    mask: radial-gradient(circle 6px at 50% 100%, transparent 5.5px, #000 6px) 0 100% / 14px 100% repeat-x;
}
.receipt p { margin: 0; }
.receipt .c { text-align: center; }
.receipt .brand { letter-spacing: .4em; font-weight: 700; }
.receipt .muted { color: var(--paper-muted); }
.receipt hr { border: 0; border-top: 1px dashed var(--paper-muted); margin: 10px 0; }
.receipt .li { display: flex; justify-content: space-between; gap: 10px; }
.receipt .li span:last-child { white-space: nowrap; text-align: right; }
.receipt .head { text-transform: uppercase; font: inherit; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.receipt .tot { font-weight: 700; font-size: 14px; }
.receipt .crowd b { font-weight: 700; }
.receipt .bars {
    height: 34px;
    margin: 12px 6px 2px;
    background: repeating-linear-gradient(90deg, var(--paper-ink) 0 2px, transparent 2px 4px, var(--paper-ink) 4px 5px, transparent 5px 8px, var(--paper-ink) 8px 11px, transparent 11px 12px);
}

.receipt .items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.receipt .item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 10px;
    padding: 5px 0;
}
.receipt .item > .it { flex: 1 1 13em; }
.receipt .item > .metoo, .receipt .item > .count { margin-left: auto; }
.receipt .item + .item { border-top: 1px dotted var(--paper-line); }
.receipt .it { display: flex; gap: 6px; align-items: baseline; min-width: 0; overflow-wrap: anywhere; }
.receipt .it .e { flex: none; display: inline-block; font-size: 15px; line-height: 1; }
.receipt .it .l { min-width: 0; }
.receipt .it .first {
    display: table;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--paper-ink);
    border: 1px solid var(--paper-ink);
    border-radius: 3px;
    padding: 0 5px;
    line-height: 1.6;
}

/* What I want: the goal people join */
.receipt .want { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.receipt .want-l { flex: 1 1 14em; min-width: 0; overflow-wrap: anywhere; }
.receipt .want-l .k { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.receipt .want-l b { font-weight: 700; }
.receipt .want-n { color: var(--paper-muted); }
.receipt .want-btn { margin-left: auto; }

/* One tap per line: an ink stamp on the paper */
.metoo {
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--paper-ink);
    background: transparent;
    border: 1.5px dashed var(--paper-ink);
    border-radius: 999px;
    min-height: 34px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, color .15s, transform .15s;
}
.metoo .mt-n { font-weight: 500; color: var(--paper-muted); transition: color .15s; }
.metoo:hover { background: rgba(31, 27, 24, .06); }
.metoo:focus-visible { outline: 2px solid var(--paper-ink); outline-offset: 2px; }
.metoo[aria-pressed="true"] { background: var(--paper-ink); color: var(--paper); border-style: solid; cursor: default; }
.metoo[aria-pressed="true"] .mt-n { color: var(--paper); }
.metoo[aria-pressed="true"] .mt-l::before { content: "✓ "; }
.metoo.stamp { animation: stamp .32s cubic-bezier(.2, .9, .3, 1.4); }
.metoo:disabled:not([aria-pressed="true"]) { opacity: .6; cursor: default; }
.count { font-size: 11.5px; color: var(--paper-muted); white-space: nowrap; }

.note { font-size: 12.5px; color: var(--muted); min-height: 19px; margin: 0; text-align: center; max-width: 400px; }
.note.warn { color: var(--warn); }
.share .note { text-align: left; }
.share .note:empty { min-height: 0; }

/* Emoji of a line plays its motion once when someone says "me too" */
.e.play[data-motion="slam"] { animation: e-slam .5s cubic-bezier(.2, .9, .3, 1.4); }
.e.play[data-motion="spin"] { animation: e-spin .7s cubic-bezier(.2, .8, .3, 1); }
.e.play[data-motion="glitch"] { animation: e-glitch .5s steps(5); }
.e.play[data-motion="float"] { animation: e-float .8s ease-out; }
.e.play[data-motion="slide"] { animation: e-slide .6s ease-in-out; }
.e.play[data-motion="shrug"] { animation: e-shrug .7s ease-in-out; }
.e.play[data-motion="echo"] { animation: e-echo .7s ease-out; }
.e.play[data-motion="rise"] { animation: e-rise .7s cubic-bezier(.2, .9, .3, 1); }
.e.play[data-motion="split"] { animation: e-split .6s ease-out; }
.e.play[data-motion="wobble"] { animation: e-wobble .7s ease-in-out; }

/* Calls to action */
.go {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -.01em;
    color: #1d1204;
    background: var(--amber);
    border: 0;
    border-radius: 16px;
    padding: 14px 16px;
    cursor: pointer;
    text-decoration: none;
    transition: filter .2s;
}
.go:hover { filter: brightness(1.07); }
.go:active { transform: scale(.99); }
.go:disabled { cursor: default; filter: saturate(.4) brightness(.8); }
.go[aria-pressed="true"] { background: var(--surface-2); color: var(--amber); border: 1px solid var(--amber); }
.cta { display: flex; flex-direction: column; gap: 8px; }
.cta .sub { text-align: center; }

.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 7px 14px;
    min-height: var(--touch);
    min-width: var(--touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { border-color: var(--amber); }
.btn.primary { background: var(--ink); color: var(--ground); border-color: var(--ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(.94); }
.btn svg { width: 16px; height: 16px; flex: none; }

.share { display: flex; flex-direction: column; gap: 10px; }
.share .hint { font-size: 12px; color: var(--faint); margin: 0; }

/* Their words */
.words blockquote {
    margin: 8px 0 0;
    padding: 2px 0 2px 14px;
    border-left: 3px solid var(--amber);
    font-size: 16px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.source { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.source a { color: var(--ink); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.source a:hover { color: var(--amber); }
.feel { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

/* Follow and the private link */
.follow { display: flex; flex-direction: column; gap: 8px; }
.follow label { font-size: 13px; color: var(--ink); }
.row-in { display: flex; gap: 8px; }
.row-in input {
    flex: 1;
    min-width: 0;
    min-height: var(--touch);
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    background: var(--ground);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    padding: 8px 12px;
}
.row-in input:focus { border-color: var(--amber); outline: none; }
.row-in button {
    min-height: var(--touch);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    color: #1d1204;
    background: var(--amber);
    border: 0;
    border-radius: 12px;
    padding: 8px 16px;
    cursor: pointer;
    white-space: nowrap;
}
.row-in button:disabled { filter: saturate(.4) brightness(.8); cursor: default; }
.follow small, .fine { font-size: 12px; color: var(--muted); }
.fine { margin: 0; }
.done { font-size: 14px; color: var(--ink); margin: 0; }

.private-url {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    background: var(--ground);
    border: 1px dashed var(--line-2);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 8px 0;
    overflow-wrap: anywhere;
    user-select: all;
}

/* Owner numbers */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.stat { background: var(--ground); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; text-align: center; }
.stat b { display: block; font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--ink); }
.stat small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }

/* Public evidence, milestones and emergences */
.more { display: flex; flex-direction: column; gap: 12px; }
.evidence p { margin: 0; font-size: 14px; }
.evidence .n { color: var(--amber); font-family: var(--mono); font-weight: 700; }
.evidence .src { color: var(--muted); }
.evidence .q { margin-top: 8px; font-size: 13px; color: var(--muted); }
.evidence .q i { color: var(--ink); }
.milestones h2 { font-size: 15px; }
.milestone { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; padding: 6px 0; font-size: 14px; }
.milestone .ok { color: var(--amber); }
.milestone small { color: var(--muted); font-size: 12px; }
.emergences { border-color: var(--amber); }
.emergence { padding: 10px 0 10px 12px; border-left: 2px solid var(--amber); margin-top: 10px; }
.emergence .meta { font-size: 11.5px; color: var(--muted); font-family: var(--mono); margin: 0 0 4px; }
.emergence .t { color: var(--amber); margin: 0 0 2px; font-weight: 600; }
.emergence p { margin: 0; font-size: 14px; }
.emergence a { display: inline-flex; align-items: center; min-height: var(--touch); font-size: 13px; color: var(--amber); }
.demo { font-size: 11.5px; color: var(--faint); text-align: center; margin: 0; }

/* Footer */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; align-items: center; font-size: 11.5px; color: var(--faint); margin: 4px 0 0; }
.foot a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: var(--touch); }
.foot a:hover { color: var(--amber); }

.lost { text-align: center; padding-top: 18vh; }
.lost h1 { font-size: 40px; }
.lost p { color: var(--muted); }
.lost a { color: var(--amber); display: inline-flex; min-height: var(--touch); align-items: center; }

/* Cookie banner (cookie-consent.js) in the same palette */
#cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--surface);
    border-top: 1px solid var(--line-2);
    padding: 14px max(16px, env(safe-area-inset-left, 0px)) calc(14px + env(safe-area-inset-bottom, 0px));
}
.cookie-banner-content { max-width: 900px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.cookie-banner-content p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 600px; }
.cookie-banner-content a { color: var(--amber); text-decoration: none; }
.cookie-banner-content .btn-primary { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.cookie-banner-content .btn {
    min-height: var(--touch);
    font: inherit;
    font-size: 13px;
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    border: 1px solid var(--line-2);
    background: var(--surface-2);
    color: var(--ink);
}

@media (max-width: 600px) {
    #cookie-banner { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
    .cookie-banner-content { gap: 8px; }
    .cookie-banner-content p { font-size: 12px; line-height: 1.45; }
    .cookie-banner-content .cookie-banner-actions { width: 100%; gap: 8px !important; flex-wrap: nowrap !important; }
    .cookie-banner-content .btn { flex: 1 1 0; padding: 8px 10px; }
}

/* Phones and touch: every control is at least 44px */
@media (max-width: 959px), (pointer: coarse) {
    .metoo { min-height: var(--touch); padding: 6px 12px; }
}

@media (min-width: 960px) {
    body.rp { padding-block: 24px 40px; }
    .rp-app { max-width: 1120px; gap: 28px; }
    .rp-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 400px;
        grid-template-rows: repeat(7, auto) 1fr;
        column-gap: 56px;
        row-gap: 20px;
        align-items: start;
    }
    .rp-layout > * { grid-column: 1; }
    .rp-layout > .rp-receipt { grid-column: 2; grid-row: 1 / -1; position: sticky; top: 24px; }
    h1 { font-size: 52px; letter-spacing: -.03em; }
    .receipt { font-size: 13px; padding: 22px 22px 26px; }
    .lede { font-size: 16px; }
    .cta { flex-direction: row; align-items: center; gap: 16px; }
    .cta .go { padding-inline: 28px; }
    .cta .sub { text-align: left; }
    .foot { justify-content: flex-start; }
    .foot a { min-height: 0; }
    .mark, .emergence a, .lost a { min-height: 0; }
}

@keyframes print { 0% { clip-path: inset(0 0 100% 0); transform: translateY(-14px); } 100% { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes stamp { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-3deg); } 100% { transform: none; } }
@keyframes e-slam { 0% { transform: scale(2) translateY(-6px); } 60% { transform: scale(.9); } 100% { transform: none; } }
@keyframes e-spin { to { transform: rotate(360deg); } }
@keyframes e-glitch { 20% { transform: translate(-2px, 1px); } 40% { transform: translate(2px, -1px); filter: hue-rotate(90deg); } 60% { transform: translate(-1px, 0); } 80% { transform: translate(1px, 1px); filter: none; } }
@keyframes e-float { 50% { transform: translateY(-6px); opacity: .6; } }
@keyframes e-slide { 30% { transform: translateX(-6px) rotate(-8deg); } 70% { transform: translateX(6px) rotate(8deg); } }
@keyframes e-shrug { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes e-echo { 0% { text-shadow: 0 0 0 rgba(31, 27, 24, .5); } 100% { text-shadow: 10px 0 0 rgba(31, 27, 24, 0); } }
@keyframes e-rise { 0% { transform: translateY(8px); opacity: .3; } 100% { transform: none; opacity: 1; } }
@keyframes e-split { 50% { transform: scaleX(1.5); letter-spacing: 4px; } }
@keyframes e-wobble { 20% { transform: rotate(-10deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

.journey-nav { color: inherit; font: 500 14px/1.4 Figtree, sans-serif; text-decoration: underline; text-underline-offset: 4px; padding: 10px 0; }
.top { flex-wrap: wrap; gap: 12px; }
