/* share.black, manifesto below the host card.
   Uses the tokens from app.css. No storage, no network, no third-party code. */

/* The host card fills the first screen; the manifesto starts below the fold. */
.screen-host { scroll-behavior: smooth; overflow-x: hidden; }
.screen-host .host-inner {
  min-height: calc(100vh - 104px - var(--safe-t) - var(--safe-b));
  min-height: calc(100svh - 104px - var(--safe-t) - var(--safe-b));
  justify-content: center;
}
.screen-host .screen-inner { margin-top: 0; margin-bottom: 0; }

/* ------------------------------------------------------------- scroll cue */
.mf-cue {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 8px auto 0; padding: 10px 18px; min-height: 64px;
  color: var(--text-2); font-size: 13px; font-weight: 500; letter-spacing: 0.02em; text-decoration: none;
  transition: color 0.2s;
}
.mf-cue:hover { color: var(--text); }
.mf-cue .ic { width: 22px; height: 22px; animation: mf-bob 2.2s var(--ease) infinite; }
@keyframes mf-bob { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(6px); opacity: 1; } }

/* ------------------------------------------------------------- article */
.mf {
  position: relative; width: 100%; max-width: 680px; margin: 0 auto;
  padding: 0 4px calc(var(--safe-b) + 40px);
  text-align: left; color: var(--text-2); font-size: 18px; line-height: 1.6;
}
.mf p { margin: 0 0 18px; }
.mf b { color: var(--text); font-weight: 600; }
.mf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Sticky reading bar */
.mf-bar {
  position: sticky; top: calc(-20px - var(--safe-t)); z-index: 5;
  margin: 0 calc(50% - 50vw); padding: calc(var(--safe-t) + 22px) calc(50vw - 50% + 4px) 10px;
  background: linear-gradient(180deg, #000 72%, rgba(0, 0, 0, 0));
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.5s var(--spring);
}
.mf.is-reading .mf-bar { opacity: 1; transform: none; }
.mf-bar-fill {
  height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--blue), #64d2ff);
  transform-origin: left; transform: scaleX(0); will-change: transform;
  box-shadow: 0 0 12px rgba(10, 132, 255, 0.6);
}
.mf-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12px; letter-spacing: 0.02em; }
.mf-bar-chapter { flex: 1; min-width: 0; }
.mf-bar-left { flex: 1; text-align: right; }
.mf.is-reading .mf-bar-play { pointer-events: auto; }
.mf-bar-play {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass-hi); box-shadow: inset 0 0 0 1px var(--hairline);
  transition: transform 0.25s var(--spring), background 0.2s;
}
.mf-bar-play:active { transform: scale(0.9); }
.mf-bar-play .ic, .mf-listen .ic { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.mf-ic-pause { display: none; }
.mf.is-playing .mf-ic-play { display: none; }
.mf.is-playing .mf-ic-pause { display: block; }
.mf.is-playing .mf-bar-play { background: var(--blue); box-shadow: 0 0 0 6px rgba(10, 132, 255, 0.18); }

/* Listen button in the hero */
.mf-listen {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 34px; padding: 14px 22px 14px 18px; border-radius: 999px; min-height: 50px;
  background: var(--glass-hi); box-shadow: inset 0 0 0 1px var(--hairline-hi); color: var(--text); font-size: 16px; font-weight: 600;
  transition: transform 0.25s var(--spring), background 0.2s, box-shadow 0.3s;
}
.mf-listen:hover { background: rgba(255, 255, 255, 0.14); }
.mf-listen:active { transform: scale(0.96); }
.mf-listen-time { color: var(--text-3); font-weight: 500; }
.mf.is-playing .mf-listen { background: var(--blue); box-shadow: 0 10px 30px -8px rgba(10, 132, 255, 0.7); }
.mf.is-playing .mf-listen-time { color: rgba(255, 255, 255, 0.75); }
.mf-listen.is-loading .ic { animation: mf-pulse 1s var(--ease) infinite; }
@keyframes mf-pulse { 50% { opacity: 0.3; } }

/* The chapter being narrated */
.mf-ch, .mf-hero, .mf-end { transition: opacity 0.6s var(--ease); }
.mf.is-playing .mf-ch:not(.is-narrating), .mf.is-playing .mf-hero:not(.is-narrating), .mf.is-playing .mf-end:not(.is-narrating) { opacity: 0.45; }
.mf .is-narrating .mf-num::after { content: " \00b7  Now playing"; color: var(--text-3); letter-spacing: 0.04em; }
.mf-bar-chapter { color: var(--text); font-weight: 600; }
.mf-bar-left { color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Chapter dots (wide screens) */
.mf-dots { display: none; }
@media (min-width: 1000px) {
  .mf-dots {
    display: flex; flex-direction: column; gap: 14px;
    position: fixed; right: calc(var(--safe-r) + 28px); top: 50%; transform: translateY(-50%);
    opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease);
  }
  .mf.is-reading .mf-dots { opacity: 1; pointer-events: auto; }
  .mf-dots a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-decoration: none; }
  .mf-dots a::after {
    content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hairline-hi);
    transition: transform 0.4s var(--spring), background 0.3s;
  }
  .mf-dots a span { font-size: 12px; color: var(--text-3); opacity: 0; transform: translateX(6px); transition: opacity 0.25s, transform 0.4s var(--spring); }
  .mf-dots a:hover span, .mf-dots a.is-on span { opacity: 1; transform: none; }
  .mf-dots a.is-on::after { background: var(--blue); transform: scale(1.5); }
  .mf-dots a.is-read::after { background: rgba(10, 132, 255, 0.55); }
}

/* ------------------------------------------------------------- hero */
.mf-hero { padding: 18vh 0 14vh; text-align: center; }
.mf-eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--blue), #64d2ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mf-hero h2 {
  margin: 0 0 26px; color: var(--text);
  font-size: clamp(38px, 8.4vw, 68px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em;
}
.mf-lede { font-size: clamp(19px, 3.2vw, 23px); max-width: 30ch; margin: 0 auto !important; }

/* Word-by-word scrub: words light up as they move up the screen */
.mf-w { opacity: 0.16; transition: opacity 0.25s linear; }
.mf-w.on { opacity: 1; }

/* ------------------------------------------------------------- chapters */
.mf-ch { padding: 12vh 0 6vh; scroll-margin-top: 40px; }
.mf-num {
  font: 600 13px/1 var(--mono); letter-spacing: 0.1em; color: var(--blue); margin-bottom: 10px !important;
}
.mf-h { margin: 0 0 28px; color: var(--text); font-size: clamp(30px, 5.6vw, 44px); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; }
.mf-big { color: var(--text); font-size: clamp(26px, 5vw, 38px); line-height: 1.18; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 30px !important; }
.mf-quiet { color: var(--text-3); font-size: 16px; }

/* Fade-up reveal */
.mf-in { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.9s var(--spring); }
.mf-in.is-in { opacity: 1; transform: none; }

/* The places your messages are kept, struck out when the default turns */
.mf-places { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0 0 34px; }
.mf-places li {
  position: relative; padding: 9px 16px; border-radius: 999px;
  background: var(--glass-hi); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--text); font-size: 16px;
  opacity: 0; transform: translateY(14px) scale(0.96);
  transition: opacity 0.5s var(--ease), transform 0.7s var(--spring), color 0.5s, background 0.5s;
  transition-delay: calc(var(--i, 0) * 90ms);
}
.mf-places.is-in li { opacity: 1; transform: none; }
.mf-places li::after {
  content: ""; position: absolute; left: 14px; right: 14px; top: 50%; height: 2px; border-radius: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease); transition-delay: calc(var(--i, 0) * 110ms);
}
.mf-places.is-wiped li { color: var(--text-3); background: var(--glass); }
.mf-places.is-wiped li::after { transform: scaleX(1); }
.mf-turn { color: var(--text); font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }

/* Beliefs: cards that stack as you scroll */
.mf-stack { position: relative; }
.mf-card {
  position: sticky; top: calc(70px + var(--i, 0) * 14px);
  margin-bottom: 22vh; padding: 30px 28px 26px; border-radius: 28px;
  background: linear-gradient(160deg, #18181b, #0c0c0e); box-shadow: inset 0 0 0 1px var(--hairline-hi), 0 30px 60px -20px rgba(0, 0, 0, 0.9);
  transform-origin: top center; transition: transform 0.5s var(--spring), filter 0.5s;
}
.mf-card:last-child { margin-bottom: 4vh; }
.mf-card.is-under { transform: scale(0.95); filter: brightness(0.6); }
.mf-card-k { font: 600 13px/1 var(--mono); color: var(--blue); letter-spacing: 0.12em; margin-bottom: 18px !important; }
.mf-card h4 { margin: 0 0 12px; color: var(--text); font-size: clamp(23px, 4.4vw, 30px); line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; }
.mf-card p:last-child { margin: 0; }

/* How it works: four steps on a line */
.mf-steps { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: mf; position: relative; }
.mf-steps li { counter-increment: mf; position: relative; padding-top: 44px; font-size: 15px; line-height: 1.4; transition-delay: calc(var(--i, 0) * 120ms); }
.mf-steps li::before {
  content: counter(mf); position: absolute; top: 0; left: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font: 600 13px/1 var(--mono); color: #fff; background: var(--blue);
  box-shadow: 0 0 0 6px rgba(10, 132, 255, 0.15);
}
.mf-steps li:last-child::before { background: var(--text-3); box-shadow: 0 0 0 6px var(--glass); }
.mf-steps b { display: block; margin-bottom: 4px; font-size: 17px; }
.mf-steps span { display: block; }
@media (max-width: 560px) {
  .mf-steps { grid-template-columns: 1fr 1fr; row-gap: 26px; }
}

/* Live encryption demo */
.mf-demo {
  margin: 0 0 44px; padding: 24px; border-radius: 28px;
  background: radial-gradient(120% 100% at 0% 0%, rgba(10, 132, 255, 0.16), transparent 60%), #0e0e10;
  box-shadow: inset 0 0 0 1px var(--hairline-hi);
}
.mf-demo-title { color: var(--text); font-weight: 600; font-size: 19px; margin-bottom: 14px !important; }
.mf-demo-input {
  width: 100%; height: 50px; padding: 0 18px; border: 0; outline: 0; border-radius: 14px;
  background: var(--glass-hi); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--text); font-size: 17px;
}
.mf-demo-input:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.mf-demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 14px; }
.mf-demo-grid > div { min-width: 0; padding: 14px 16px; border-radius: 16px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 1px var(--hairline); }
.mf-demo-k { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px !important; }
.mf-demo-plain { color: var(--text); font-size: 17px; margin: 0 !important; overflow-wrap: anywhere; min-height: 1.5em; }
.mf-demo-cipher { color: #64d2ff; font: 500 13px/1.5 var(--mono); margin: 0 !important; overflow-wrap: anywhere; word-break: break-all; min-height: 1.5em; }
.mf-demo-cipher.is-flash { animation: mf-flash 0.35s var(--ease); }
@keyframes mf-flash { from { opacity: 0.35; } to { opacity: 1; } }
.mf-demo-note { font-size: 13px; color: var(--text-3); margin: 0 !important; }
@media (max-width: 480px) { .mf-demo-grid { grid-template-columns: 1fr; } .mf-demo { padding: 20px 18px; } }

.mf-facts { list-style: none; padding: 0; margin: 0; }
.mf-facts li { position: relative; padding: 16px 0 16px 34px; border-top: 1px solid var(--hairline); }
.mf-facts li::before {
  content: ""; position: absolute; left: 2px; top: 22px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 5px rgba(48, 209, 88, 0.14);
  -webkit-mask: none;
}

/* Never: lines start redacted and are revealed one by one */
.mf-never { list-style: none; padding: 0; margin: 10px 0 0; }
.mf-never li { padding: 14px 0; border-top: 1px solid var(--hairline); color: var(--text); font-size: clamp(19px, 3.4vw, 23px); font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.mf-never span {
  padding: 0 3px; margin: 0 -3px; border-radius: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(#e8e8ed, #e8e8ed) no-repeat right center / 100% 100%;
  transition: background-size 0.8s cubic-bezier(0.7, 0, 0.2, 1);
}
.mf-never li.is-in span { background-size: 0% 100%; }

/* Limits: honest accordions */
.mf-limits { margin: 6px 0 22px; }
.mf-limits details { border-top: 1px solid var(--hairline); }
.mf-limits details:last-child { border-bottom: 1px solid var(--hairline); }
.mf-limits summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 2px; color: var(--text); font-size: 19px; font-weight: 600; letter-spacing: -0.01em;
}
.mf-limits summary::-webkit-details-marker { display: none; }
.mf-limits summary::after {
  content: "+"; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass-hi); color: var(--text-2); font-size: 20px; font-weight: 400; line-height: 1;
  transition: transform 0.4s var(--spring), background 0.2s;
}
.mf-limits details[open] summary::after { transform: rotate(45deg); background: rgba(255, 159, 10, 0.2); color: var(--orange); }
.mf-limits details p { margin: -4px 0 18px !important; padding-right: 40px; animation: mf-open 0.45s var(--spring); }
@keyframes mf-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Principles with a live count */
.mf-count { font: 600 13px/1 var(--mono); color: var(--text-3); letter-spacing: 0.08em; margin: -14px 0 18px !important; }
.mf-count span { color: var(--blue); }
.mf-principles { list-style: none; padding: 0; margin: 0; counter-reset: p; }
.mf-principles li {
  counter-increment: p; position: relative; padding: 18px 0 18px 64px; border-top: 1px solid var(--hairline);
  opacity: 0.22; transform: translateX(-6px);
  transition: opacity 0.6s var(--ease), transform 0.7s var(--spring);
}
.mf-principles li.is-in { opacity: 1; transform: none; }
.mf-principles li::before {
  content: counter(p, decimal-leading-zero); position: absolute; left: 0; top: 14px;
  font-size: 34px; font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.25)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mf-principles b { display: block; font-size: 20px; margin-bottom: 2px; }

/* Ending */
.mf-end { padding: 22vh 0 10vh; text-align: center; }
.mf-final { margin: 0 0 22px !important; color: var(--text); font-size: clamp(36px, 8vw, 64px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.08; }
.mf-final span { display: inline-block; opacity: 0; transform: translateY(18px); filter: blur(8px); transition: opacity 0.8s var(--ease), transform 1s var(--spring), filter 0.8s; }
.mf-final span:nth-child(2) { transition-delay: 0.35s; }
.mf-final span:nth-child(3) { transition-delay: 0.7s; }
.mf-end.is-in .mf-final span { opacity: 1; transform: none; filter: none; }
.mf-end.is-in .mf-final span:nth-child(3) { animation: mf-trace 4.5s 1.8s var(--ease) infinite; }
@keyframes mf-trace {
  0%, 55%, 100% { opacity: 1; filter: none; }
  75% { opacity: 0.08; filter: blur(10px); }
}
.mf-done { font-size: 15px; color: var(--text-3); opacity: 0; transition: opacity 0.8s var(--ease); }
.mf-done.is-in { opacity: 1; }
.mf-cta {
  margin-top: 12px; padding: 16px 30px; border-radius: 999px; min-height: 52px;
  background: var(--blue); color: #fff; font-size: 17px; font-weight: 600;
  box-shadow: 0 10px 30px -8px rgba(10, 132, 255, 0.7);
  transition: transform 0.25s var(--spring), background 0.2s;
}
.mf-cta:hover { background: #2b95ff; }
.mf-cta:active { transform: scale(0.96); }

/* Without the script, show everything as plain text. */
.mf:not(.mf-on) .mf-in, .mf:not(.mf-on) .mf-places li, .mf:not(.mf-on) .mf-principles li,
.mf:not(.mf-on) .mf-final span { opacity: 1; transform: none; filter: none; }
.mf:not(.mf-on) .mf-never span { background: none; }

/* No motion for people who asked for none: everything is simply there. */
@media (prefers-reduced-motion: reduce) {
  .screen-host { scroll-behavior: auto; }
  .mf-cue .ic { animation: none; }
  .mf-w { opacity: 1; }
  .mf-in, .mf-places li, .mf-principles li, .mf-final span { opacity: 1 !important; transform: none !important; filter: none !important; }
  .mf-never span { background: none; }
  .mf-card { position: relative; top: auto; margin-bottom: 18px; }
  .mf-card.is-under { transform: none; filter: none; }
  .mf-end.is-in .mf-final span:nth-child(3) { animation: none; }
}
